I have several fragments in activity, changed by bottombar. I tried to implement fragment state handling by using Once for all, how to correctly save instance state of Fragments in back stack? The problem is that
mContent = getSupportFragmentManager().getFragment(savedInstanceState, TAG);
Returns the next error:
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
While debugging I have the next savedInstanceSet:
ArrayMap@5665, size = 4
value[0]=Bundle
value[1]="FragmentName"
value[2]=FragmentManagerState
value[3]={Integer}"0"
Please dont paste solutions like
setRetainInstance(true),
android:configChanges="orientation|screenSize"
and so on, because I need to recreate fragment (different xml files for land and portrait).