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

  • SEARCH
  • Home
  • 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 7847097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:47:10+00:00 2026-06-02T17:47:10+00:00

i m creating a project with three main activities (lets call them Activity 1,

  • 0

i m creating a project with three main activities (lets call them Activity 1, 2 and 3).
In activity 1, i pass the number in my bundle extra.

newActivity.putExtra("LAT", getText(R.string.LAT1));
newActivity.putExtra("LNG", getText(R.string.LNG1));

then,in the 2nd one, i get this like:

     double Lata;
    double Lnga;

//in onCreate..
        Bundle extras = getIntent().getExtras();

        Lata = extras.getDouble("LAT");
        Lnga = extras.getDouble("LNG");

and then,i m passing them to the 3rd activity like this:

newActivity.putExtra("LAT",Lata);
newActivity.putExtra("LNG",Lnga);

Finally, in the 3rd activity:

public class mapview extends MapActivity
{
 @Override  
 public void onCreate(Bundle savedInstanceState)
 {
 super.onCreate(savedInstanceState);
 requestWindowFeature(Window.FEATURE_NO_TITLE);

 setContentView(R.layout.map);

 MapView mapView = (MapView) findViewById(R.id.mapview);
 mapView.setBuiltInZoomControls(true);
 //mapView.setSatellite(true);
 //mapView.setStreetView(true);
 List<Overlay> mapOverlays = mapView.getOverlays();
  Drawable drawable = this.getResources().getDrawable(R.drawable.pin);
 HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable,this);

 Bundle extras = getIntent().getExtras();
final double Latc = extras.getDouble("LAT");
 final double Lngc = extras.getDouble("LNG");
Integer txt_map = extras.getInt("MAP_NAME");





 TextView mapname=(TextView)findViewById(R.id.museum_address_name);
 mapname.setText(getText(txt_map));

 Double lat = Double.valueOf(Latc*1E6);

    Double lng = Double.valueOf(Lngc*1E6);

    //---------------------------------------------------
    GeoPoint center = new GeoPoint(Double.valueOf(Latc*1E6).intValue(), Double.valueOf(Lngc*1E6).intValue());
    MapController controller = mapView.getController();
        controller.setCenter(center);
    controller.setZoom(15);
    //---------------------------------------------------

    GeoPoint point = new GeoPoint(lat.intValue(), lng.intValue());
 OverlayItem overlayitem = new OverlayItem(point, "", "");


 itemizedoverlay.addOverlay(overlayitem);

 mapOverlays.add(itemizedoverlay);
 }
 @Override
 protected boolean isRouteDisplayed()
 {
 return false;
 }
}

The result is somewhere in South America,but my lat and long are in europe..What am i doing wrong?i m trying to fix it for more than 2 hours…:(

EDIT

04-25 23:58:19.001: W/KeyCharacterMap(3746): No keyboard for id 0
04-25 23:58:19.081: W/KeyCharacterMap(3746): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
04-25 23:58:22.461: W/Bundle(3746): Key LAT expected Double but value was a java.lang.Integer.  The default value 0.0 was returned.
04-25 23:58:22.481: W/Bundle(3746): Attempt to cast generated internal exception:
04-25 23:58:22.481: W/Bundle(3746): java.lang.ClassCastException: java.lang.Integer
04-25 23:58:22.481: W/Bundle(3746):     at android.os.Bundle.getDouble(Bundle.java:1017)
04-25 23:58:22.481: W/Bundle(3746):     at android.os.Bundle.getDouble(Bundle.java:1000)
04-25 23:58:22.481: W/Bundle(3746):     at kostas.menu.athensmuseums.museum_item.onCreate(museum_item.java:39)
04-25 23:58:22.481: W/Bundle(3746):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-25 23:58:22.481: W/Bundle(3746):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
04-25 23:58:22.481: W/Bundle(3746):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-25 23:58:22.481: W/Bundle(3746):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-25 23:58:22.481: W/Bundle(3746):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-25 23:58:22.481: W/Bundle(3746):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-25 23:58:22.481: W/Bundle(3746):     at android.os.Looper.loop(Looper.java:123)
04-25 23:58:22.481: W/Bundle(3746):     at android.app.ActivityThread.main(ActivityThread.java:4627)
04-25 23:58:22.481: W/Bundle(3746):     at java.lang.reflect.Method.invokeNative(Native Method)
04-25 23:58:22.481: W/Bundle(3746):     at java.lang.reflect.Method.invoke(Method.java:521)
04-25 23:58:22.481: W/Bundle(3746):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-25 23:58:22.481: W/Bundle(3746):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-25 23:58:22.481: W/Bundle(3746):     at dalvik.system.NativeStart.main(Native Method)
04-25 23:58:22.481: W/Bundle(3746): Key LNG expected Double but value was a java.lang.Integer.  The default value 0.0 was returned.
04-25 23:58:22.491: W/Bundle(3746): Attempt to cast generated internal exception:
04-25 23:58:22.491: W/Bundle(3746): java.lang.ClassCastException: java.lang.Integer
04-25 23:58:22.491: W/Bundle(3746):     at android.os.Bundle.getDouble(Bundle.java:1017)
04-25 23:58:22.491: W/Bundle(3746):     at android.os.Bundle.getDouble(Bundle.java:1000)
04-25 23:58:22.491: W/Bundle(3746):     at kostas.menu.athensmuseums.museum_item.onCreate(museum_item.java:40)
04-25 23:58:22.491: W/Bundle(3746):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-25 23:58:22.491: W/Bundle(3746):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
04-25 23:58:22.491: W/Bundle(3746):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-25 23:58:22.491: W/Bundle(3746):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-25 23:58:22.491: W/Bundle(3746):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-25 23:58:22.491: W/Bundle(3746):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-25 23:58:22.491: W/Bundle(3746):     at android.os.Looper.loop(Looper.java:123)
04-25 23:58:22.491: W/Bundle(3746):     at android.app.ActivityThread.main(ActivityThread.java:4627)
04-25 23:58:22.491: W/Bundle(3746):     at java.lang.reflect.Method.invokeNative(Native Method)
04-25 23:58:22.491: W/Bundle(3746):     at java.lang.reflect.Method.invoke(Method.java:521)
04-25 23:58:22.491: W/Bundle(3746):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-25 23:58:22.491: W/Bundle(3746):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-25 23:58:22.491: W/Bundle(3746):     at dalvik.system.NativeStart.main(Native Method)
04-25 23:58:24.251: W/MapActivity(3746): Recycling dispatcher com.google.googlenav.datarequest.DataRequestDispatcher@44ec4318
  • 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-02T17:47:11+00:00Added an answer on June 2, 2026 at 5:47 pm

    I suspect that getText returns a String or a CharSequence so you’re putting a string into the bundle but reading it as a double. Instead, make sure you convert it to a double first:

    newActivity.putExtra("LAT", Double.parseDouble(getText(R.string.LAT1)));
    newActivity.putExtra("LNG", Double.parseDouble(getText(R.string.LNG1)));
    

    That’s assuming you’ve already properly validated that your TextViews really contain a valid double.

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

Sidebar

Related Questions

For a homework project, I'm creating a PHP driven website which main function is
I'm creating a project where there will be a main database (where are some
I am creating solution and inside I have three projects: A WCF Service Library
I'm currently creating a website for a social project in switzerland. And before there
When creating a project with the webapp archetype in Maven, they subtly advise not
When I'm creating new project with GWT plug in it creates a skeleton project
I'm creating a project to house an iPhone library for common code for the
I'm creating a project from the book Sanderson Pro ASp.net mvc3. But I have
I have been busy in my project creating a webapp (in struts) that manages
When creating a CodeIgniter project, what is the best way to handle relations between

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.