FragNav
FragNav copied to clipboard
3.0.0 error: savedInstanceState.getString(EXTRA_CURRENT_FRAGMENT) must not be null
Hiya, I updated to 3.0.0 and I'm getting the following issue now in my Crashlytics:
Caused by java.lang.IllegalStateException
savedInstanceState.geString(EXTRA_CURRENT_FRAGMENT) must not be null
com.ncapdevi.fragnav.FragNavController.restoreFromBundle
com.ncapdevi.fragnav.FragNavController.restoreFromBundle (FragNavController.kt:792)
com.ncapdevi.fragnav.FragNavController.initialize (FragNavController.kt:187)
com.mycompany.myapp.activities.MainActivity.onCreate (MainActivity.java:200)
Not sure why it happens, but this is basically what I'm doing now: MainActivity (single activity app): onCreate:
fragNavController = new FragNavController(getSupportFragmentManager(), R.id.fragment_container);
fragNavController.setRootFragmentListener(this);
fragNavController.initialize(FragNavController.NO_TAB, savedInstanceState);
onSaveInstanceState:
if (fragNavController != null) fragNavController.onSaveInstanceState(outState);
The fragments being pushed in the MainActivity are currently added with allowStateLoss(true), not sure if this matters.
Devices were in the foreground, and crash occurred on most Android versions.
Any update or a temporary fix on this? Currently experiencing many crashes by this issue
Apologies on the major delay on this. The bug report is valid and complete. I'm searching into it now to see if I can sort it out.