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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:33:32+00:00 2026-05-26T10:33:32+00:00

I’ve been trying to create what I would have imagined would be a rather

  • 0

I’ve been trying to create what I would have imagined would be a rather simple application – on the start activity, there is a button to press and that will then launch a MapActivity displaying your current location.

However, whenever I press the button, I immediately a receive an error and am forced to quit the application.

Here’s the log:

10-23 19:15:10.826: D/PhoneWindow(3227): DebugMonitor class=com.android.find.my.friends.MainActivity focus=true
10-23 19:15:19.496: D/AndroidRuntime(3227): Shutting down VM
10-23 19:15:19.496: W/dalvikvm(3227): threadid=3: thread exiting with uncaught exception (group=0x4001db88)
10-23 19:15:19.496: E/AndroidRuntime(3227): Uncaught handler: thread main exiting due to uncaught exception
10-23 19:15:19.506: E/AndroidRuntime(3227): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.find.my.friends/com.android.find.my.friends.ShowMap}: java.lang.NullPointerException
10-23 19:15:19.506: E/AndroidRuntime(3227):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2464)
10-23 19:15:19.506: E/AndroidRuntime(3227):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2486)
10-23 19:15:19.506: E/AndroidRuntime(3227):     at android.app.ActivityThread.access$2100(ActivityThread.java:123)
10-23 19:15:19.506: E/AndroidRuntime(3227):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1843)
10-23 19:15:19.506: E/AndroidRuntime(3227):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-23 19:15:19.506: E/AndroidRuntime(3227):     at android.os.Looper.loop(Looper.java:123)
10-23 19:15:19.506: E/AndroidRuntime(3227):     at android.app.ActivityThread.main(ActivityThread.java:4321)
10-23 19:15:19.506: E/AndroidRuntime(3227):     at java.lang.reflect.Method.invokeNative(Native Method)
10-23 19:15:19.506: E/AndroidRuntime(3227):     at java.lang.reflect.Method.invoke(Method.java:521)
10-23 19:15:19.506: E/AndroidRuntime(3227):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
10-23 19:15:19.506: E/AndroidRuntime(3227):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
10-23 19:15:19.506: E/AndroidRuntime(3227):     at dalvik.system.NativeStart.main(Native Method)
10-23 19:15:19.506: E/AndroidRuntime(3227): Caused by: java.lang.NullPointerException
10-23 19:15:19.506: E/AndroidRuntime(3227):     at com.android.find.my.friends.ShowMap.onCreate(ShowMap.java:30)
10-23 19:15:19.506: E/AndroidRuntime(3227):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
10-23 19:15:19.506: E/AndroidRuntime(3227):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2418)
10-23 19:15:19.506: E/AndroidRuntime(3227):     ... 11 more
10-23 19:15:19.516: I/dalvikvm(3227): threadid=7: reacting to signal 3
10-23 19:15:19.546: I/dalvikvm(3227): Wrote stack trace to '/data/anr/traces.txt'

I am testing this on an HTC Tattoo running Android 1.6. I have also previously been able to create an app which displays just the MapActivity.

Any help guys?

[Edit]

Here’s my onCreate method:

    @Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main); // bind the layout to the activity

    mapView = (MapView) findViewById(R.id.mapview);
    mapView.setBuiltInZoomControls(true);
    mapView.setStreetView(true);
    mapController = mapView.getController();
    mapController.setZoom(14); // Zoom 1 is world view
    locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0,
            0, new GeoUpdateHandler());

}
  • 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-26T10:33:32+00:00Added an answer on May 26, 2026 at 10:33 am

    It appears that you have a NullPointerException at line 30 in your ShowMap class. If you could post your onCreate method and line 30 I can help you figure out why.

    Could you also paste the line that the exception happens on by itself? It is possible that findViewById returns null, in which case your mapView will be null. Make sure the layout that your MapView is defined in is the same layout that you pass into setContentView.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have just tried to save a simple *.rtf file with some websites and
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,

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.