java.lang.NullPointerException: Attempt to write to field 'android.support.v4.app.FragmentManagerImpl android.support.v4.app.Fragment.mFragmentManager' on a null object reference

Stack Overflow | RoyalCediee | 8 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to Rafael Fischer Viola . Or join the community to write better ones.
  1. 0

    app crashes when opening another activity in Navigation Drawer

    Stack Overflow | 8 months ago | RoyalCediee
    java.lang.NullPointerException: Attempt to write to field 'android.support.v4.app.FragmentManagerImpl android.support.v4.app.Fragment.mFragmentManager' on a null object reference
  2. 0
    samebug tip
    You can't use hide() or remove() or many things with NULL values, try checking for NULL before calling this methods.
  3. 0
    samebug tip
    Also, check if you're not using android.support.v4.app.FragmentTransaction with android.app.Fragment and vice-versa
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Fragment in Navigation Drawer not loading and makes the app crash. What can I do?

    Stack Overflow | 2 years ago | SergioAAV
    java.lang.NullPointerException: Attempt to write to field 'android.support.v4.app.FragmentManagerImpl android.support.v4.app.Fragment.mFragmentManager' on a null object reference
  6. 0

    App crashes after suspend

    GitHub | 2 years ago | TIIUNDER
    java.lang.RuntimeException: Unable to start activity ComponentInfo{neeedo.imimaprx.htw.de.neeedo/neeedo.imimaprx.htw.de.neeedo.MainActivity}: java.lang.NullPointerException: Attempt to write to field 'android.support.v4.app.FragmentManagerImpl android.support.v4.app.Fragment.mFragmentManager' on a null object reference
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 write to field 'android.support.v4.app.FragmentManagerImpl android.support.v4.app.Fragment.mFragmentManager' on a null object reference

    at android.support.v4.app.BackStackRecord.doAddOp()
  2. Android Support v4
    BackStackRecord.replace
    1. android.support.v4.app.BackStackRecord.doAddOp(BackStackRecord.java:418)
    2. android.support.v4.app.BackStackRecord.replace(BackStackRecord.java:453)
    3. android.support.v4.app.BackStackRecord.replace(BackStackRecord.java:445)
    3 frames
  3. application.cedie.myapplication
    MainActivity.onNavigationItemSelected
    1. application.cedie.myapplication.MainActivity.onNavigationItemSelected(MainActivity.java:128)
    1 frame
  4. android.support.design
    NavigationView$1.onMenuItemSelected
    1. android.support.design.widget.NavigationView$1.onMenuItemSelected(NavigationView.java:151)
    1 frame
  5. android.support.v7
    MenuBuilder.performItemAction
    1. android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:811)
    2. android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
    3. android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:958)
    3 frames
  6. android.support.design
    NavigationMenuPresenter$1.onClick
    1. android.support.design.internal.NavigationMenuPresenter$1.onClick(NavigationMenuPresenter.java:318)
    1 frame
  7. Android Platform
    ActivityThread.main
    1. android.view.View.performClick(View.java:4756)
    2. android.view.View$PerformClick.run(View.java:19761)
    3. android.os.Handler.handleCallback(Handler.java:739)
    4. android.os.Handler.dispatchMessage(Handler.java:95)
    5. android.os.Looper.loop(Looper.java:135)
    6. android.app.ActivityThread.main(ActivityThread.java:5253)
    6 frames
  8. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:372)
    2 frames
  9. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:949)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:744)
    2 frames