java.lang.NullPointerException: Attempt to invoke virtual method 'android.support.v4.app.FragmentManager android.support.v4.app.FragmentActivity.getSupportFragmentManager()' on a null object reference then the application crushs java.lang.NullPointerException: Attempt to invoke virtual method 'android.support.v4.app.FragmentManager android.support.v4.app.FragmentActivity.getSupportFragmentManager()' on a null object reference

Stack Overflow | almsry | 1 month ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael . Or join the community to write better ones.
  1. 0

    Android OnBackpressed in Fragment Null Exception

    Stack Overflow | 1 month ago | almsry
    java.lang.NullPointerException: Attempt to invoke virtual method 'android.support.v4.app.FragmentManager android.support.v4.app.FragmentActivity.getSupportFragmentManager()' on a null object reference then the application crushs java.lang.NullPointerException: Attempt to invoke virtual method 'android.support.v4.app.FragmentManager android.support.v4.app.FragmentActivity.getSupportFragmentManager()' on a null object reference
  2. 0

    Crash in transit fragment due to NullPointerException

    GitHub | 2 years ago | adelq
    java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.MapView.onDestroy()' on a null object reference
  3. 0

    Back button is processed after activity destroy is called

    Stack Overflow | 1 year ago | Eugen Martynov
    java.lang.NullPointerException: Attempt to invoke interface method 'com.mycompany.myapp.fragments.timeline.TimelineFragmentView com.mycompany.myapp.injections.FragmentComponent.createTimelineFragmentView()' on a null object reference
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    NullPointer Exception on setAdapter()

    Stack Overflow | 2 years ago | Prashanth
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.prashanth.sunshine/com.example.prashanth.sunshine.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter(android.widget.ListAdapter)' on a null object reference
  6. 0
    samebug tip
    As of SDK 23, you have to call this method with ContextCompat.getColor(context, R.color.my_color) so it works with previous API as well. Also, you have to add the support V4 library to your dependencies: "compile 'com.android.support:support-v4:23.0.1'"

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'android.support.v4.app.FragmentManager android.support.v4.app.FragmentActivity.getSupportFragmentManager()' on a null object reference then the application crushs java.lang.NullPointerException: Attempt to invoke virtual method 'android.support.v4.app.FragmentManager android.support.v4.app.FragmentActivity.getSupportFragmentManager()' on a null object reference

      at com.teqneia.blooddonation.BasicInfoFragment.doBack()
    2. com.teqneia.blooddonation
      MainActivity.onBackPressed
      1. com.teqneia.blooddonation.BasicInfoFragment.doBack(BasicInfoFragment.java:245)
      2. com.teqneia.blooddonation.MainActivity.onBackPressed(MainActivity.java:258)
      2 frames
    3. Android Platform
      Activity.dispatchKeyEvent
      1. android.app.Activity.onKeyUp(Activity.java:2530)
      2. android.view.KeyEvent.dispatch(KeyEvent.java:2726)
      3. android.app.Activity.dispatchKeyEvent(Activity.java:2798)
      3 frames
    4. Android v7
      WindowCallbackWrapper.dispatchKeyEvent
      1. android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:543)
      2. android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:53)
      3. android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:315)
      4. android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:53)
      4 frames
    5. Android
      PhoneWindow$DecorView.dispatchKeyEvent
      1. com.android.internal.policy.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2368)
      1 frame
    6. Android Platform
      ActivityThread.main
      1. android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4333)
      2. android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4295)
      3. android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3836)
      4. android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3889)
      5. android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3855)
      6. android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3981)
      7. android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3863)
      8. android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4038)
      9. android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3836)
      10. android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3889)
      11. android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3855)
      12. android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3863)
      13. android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3836)
      14. android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3889)
      15. android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3855)
      16. android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4014)
      17. android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4175)
      18. android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2378)
      19. android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1999)
      20. android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1990)
      21. android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2355)
      22. android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
      23. android.os.MessageQueue.nativePollOnce(Native Method)
      24. android.os.MessageQueue.next(MessageQueue.java:330)
      25. android.os.Looper.loop(Looper.java:137)
      26. android.app.ActivityThread.main(ActivityThread.java:5546)
      26 frames
    7. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      1 frame
    8. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
      2 frames