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 649143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:54:39+00:00 2026-05-13T21:54:39+00:00

Going round in circles here i think. I have an activity called Locate; public

  • 0

Going round in circles here i think.

I have an activity called Locate;

public class Locate extends Activity {

public static String lat;
public static String lon;
public static String number;

    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.locate);

    final Button buttonMaps = (Button) findViewById(R.id.ButtonMaps);
    buttonMaps.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
         Toast.makeText(getBaseContext(), "Button Pressed", Toast.LENGTH_SHORT).show();


        try {
         Intent i = new Intent(getBaseContext(), displayMap.class);
         i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         startActivity(i);
         }
         catch (ActivityNotFoundException e) {
          Toast.makeText(getBaseContext(), "Activity Not Found", Toast.LENGTH_SHORT).show(); 
         }



    }});

// Toast.makeText(getBaseContext(), "lat: " + lat + " long: " + lon + " from: " + testname, Toast.LENGTH_LONG).show();
}

If I make the displayMap class into a normal Activity, and just have display a toast message confirming it has loaded – then it works fine.

If i do this though;

public class displayMap extends MapActivity 
{    
/** Called when the activity is first created. */
public void onCreate()
{

    setContentView(R.layout.displaymap);
    Toast.makeText(getBaseContext(), "Display Map", Toast.LENGTH_SHORT).show();
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}

Then as soon as I click the Button, I get a force close.

I have the correct ‘uses-library’ tag in my manifest;

<application android:icon="@drawable/icon" android:label="@string/app_name"> 
<uses-library android:name="com.google.android.maps" />

I don’t get what it just force closes everytime i try and load it.

If I make this my onClick handler then it will fire up a working googlemaps/default mapview

        public void onClick(View v) {
         Toast.makeText(getBaseContext(), "Button Pressed", Toast.LENGTH_SHORT).show();

         Uri uri=Uri.parse("geo:"+Locate.lat+","+Locate.lon);
         StartActivity(new Intent(Intent.ACTION_VIEW, uri));
         }

But that is not what I am trying to do, I want my own – so that I can add overlays etc to it. But it does prove that the permission are set correctly and that the lib is there.

The logcat error when the app FCs is a Unexpected DEX error.

Can anyone point in the right direction here?

  • 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-05-13T21:54:40+00:00Added an answer on May 13, 2026 at 9:54 pm

    Ok, i found the problem. For some reason I had google apis, and then the maps.jar listed on my buildpath / lib in eclipse. Cleaned it up and it’s working as expected now.

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

Sidebar

Related Questions

Im going round in circles on this. I have a class Person, eg public
I need some help here, I'm currently going round in circles. I have a
Something really odd going on here, and I have gone round in circles trying
Weird question this, going round in circles. I have 2 pages. Page 1. Has
I seem to be going round in circles. I have a WPF application that
ok - going round in circles here so any help welcome... using ffmpeg to
I have been going round in circles trying to extract meta tag information from
I'm going round in circles at the moment trying to get the pattern right
Going through the microsoft authentication tutorial listed here they have you create a master
I've been going round in circles with what must be a very simple challenge

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.