java.lang.RuntimeException: Unable to pause activity {com.joulespersecond.seattlebusbot/org.onebusaway.android.ui.HomeActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'double android.location.Location.getLatitude()' on a null object reference

GitHub | barbeau | 8 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    NPE in BaseMapFragment getting map center location in onPause()

    GitHub | 8 months ago | barbeau
    java.lang.RuntimeException: Unable to pause activity {com.joulespersecond.seattlebusbot/org.onebusaway.android.ui.HomeActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'double android.location.Location.getLatitude()' on a null object reference

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'double android.location.Location.getLatitude()' on a null object reference

      at org.onebusaway.android.map.googlemapsv2.BaseMapFragment.onPause()
    2. org.onebusaway.android
      BaseMapFragment.onPause
      1. org.onebusaway.android.map.googlemapsv2.BaseMapFragment.onPause(BaseMapFragment.java:283)
      1 frame
    3. Android Support v4
      FragmentActivity.onPause
      1. android.support.v4.app.Fragment.performPause(Fragment.java:2123)
      2. android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1118)
      3. android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1248)
      4. android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1230)
      5. android.support.v4.app.FragmentManagerImpl.dispatchPause(FragmentManager.java:2056)
      6. android.support.v4.app.FragmentController.dispatchPause(FragmentController.java:198)
      7. android.support.v4.app.FragmentActivity.onPause(FragmentActivity.java:401)
      7 frames
    4. org.onebusaway.android
      HomeActivity.onPause
      1. org.onebusaway.android.ui.HomeActivity.onPause(HomeActivity.java:338)
      1 frame
    5. Android Platform
      ActivityThread.main
      1. android.app.Activity.performPause(Activity.java:6731)
      2. android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1338)
      3. android.app.ActivityThread.performPauseActivity(ActivityThread.java:4415)
      4. android.app.ActivityThread.performPauseActivity(ActivityThread.java:4388)
      5. android.app.ActivityThread.handlePauseActivity(ActivityThread.java:4363)
      6. android.app.ActivityThread.access$1200(ActivityThread.java:210)
      7. android.app.ActivityThread$H.handleMessage(ActivityThread.java:1722)
      8. android.os.Handler.dispatchMessage(Handler.java:102)
      9. android.os.Looper.loop(Looper.java:145)
      10. android.app.ActivityThread.main(ActivityThread.java:6938)
      10 frames
    6. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:372)
      2 frames
    7. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
      2 frames