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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:34:02+00:00 2026-06-12T23:34:02+00:00

I have an app that has been pretty stable so far, and I decided

  • 0

I have an app that has been pretty stable so far, and I decided I wanted to add a MapView to it. The MapView is in a HorizontalScrollView if that makes a difference. I converted my main activity to extend MapActivity and added the isRouteDisplayed() function. I can compile and run it, scrolling over to see my MapView loading correctly.

My issue is when super.onDestroy() gets called. For some reason, the program crashes.

LogCat:

10-17 18:32:17.109: E/AndroidRuntime(5477): Caused by:
java.lang.NullPointerException 10-17 18:32:17.109:
E/AndroidRuntime(5477): at
com.google.android.maps.MapActivity.onDestroy(MapActivity.java:500)
10-17 18:32:17.109: E/AndroidRuntime(5477): at
com.appsmith.mapit.MainActivity.onDestroy(MainActivity.java:177) 10-17
18:32:17.109: E/AndroidRuntime(5477): at
android.app.ActivityThread.performDestroyActivity(ActivityThread.java:2663)
10-17 18:32:17.109: E/AndroidRuntime(5477): … 11 more

 @Override
 public void onDestroy()
 {
        internalSave();
        writeOutLookupTable("Unit");
        gpsManager.removeUpdates(myListener);
        super.onDestroy(); //MainActivity.java Line 177
        finish();
 }

Any advice for troubleshooting this would be greatly appreciated.

EDIT: Got it! I implemented an onPause() that had identical information to my onDestroy() (it was my solution to keep the GPS from being active when the app wasn’t in use). Commenting out the onPause() makes everything happy again. Thanks for the help!

  • 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-12T23:34:04+00:00Added an answer on June 12, 2026 at 11:34 pm

    You dont need to call finish(); inside onDestroy(), finish() as docs says: “Call this when your activity is done and should be closed.”, so if you are in onDestroy() then your activitiy is already being finished

    Also super.onDestroy(); is usually being put at the top of onDestroy().

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

Sidebar

Related Questions

I have an iphone app that has been submitted that makes a lot of
I have built a Facebook app using the Javascript SDK that has been up
I have an app that has a mapview, and it shows 20 pins (from
I have a question that has pretty much been asked here: asp.net mvc Html.ActionLink()
I have a Rails app that has been running fine for months. The other
Have an app that has listings - think classified ads - and each listing
I have an app that has different names for different languages. How do I
I have an app that has a centre view with two views off to
I have an app that has a tabbar at the bottom. When I select
I have an app that has a TableView, NavigationView and TabBar running together. There

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.