Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8125137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:42:48+00:00 2026-06-06T06:42:48+00:00

In my app I send some intent extras from one activity to another. But

  • 0

In my app I send some intent extras from one activity to another. But some users report back that these data are always zero – even though I can see the values are alright in the sending activity.

Here’s the code of the sending activity:

Intent intent = new Intent();
intent.setClass(waypointListView.this, addWaypointActivity.class);
intent.putExtra("latitude", String.format("%9.6f", globLatitude));
intent.putExtra("longitude", String.format("%9.6f", globLongitude));
startActivityForResult(intent, ACTIVITY_ADD_WAYPOINT);

And this is how it’s read in the new activity:

Intent myIntent = getIntent();
String latitudeStr = myIntent.getExtras().getString("latitude");

try{
  globLatitude = Float.parseFloat(latitudeStr);
} catch(NumberFormatException nfe) {    
  globLatitude=0f;
}

String longitudeStr = myIntent.getExtras().getString("longitude");

try{
  globLongitude = Float.parseFloat(longitudeStr);
} catch(NumberFormatException nfe) {    
  globLongitude=0f;
}

On both my devices it works fine, but I have 3 cases of customers complaining that it doesn’t work (documented in video recordings).

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T06:42:50+00:00Added an answer on June 6, 2026 at 6:42 am

    I tried to change the code to use getFloatExtra() instead of getString and parse it to a float, and it solved the problem. I see this is a lot more efficient, but I still don’t understand why the original solution worked on some devices but not on others.

    Case closed!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to send a bundle from one activity to another. When I
i wish to send some data as array from my iphone app to server
I am trying to send some text in an email from my cocoa app
i launch the Default SMS Activity from my Android app in order to send
I want to send a broadcast (or is it an intent?) from my app
Having some trouble passing values from one class to another. I basically have a
Is there some way that an Android app written in Air can send data
I am trying to create an app that will send some data to a
hi friends i am unable to send Broadcast from one activity to other activity
I have two applications. One app has the Activity and another one is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.