The question title may sounds complicated but here is my situation.
I have a map fragment within an activity. Simple. turn on Storage permission to allow display of Map, works fine. Backgrounds the app by pressing Home button, then turn off the Storage permission and open the app from recent task, app crashes.
The problem is instead of calling onResume() of the host Activity, onCreate() is called on the host Activity as well as onCreateView() of the Map fragment. Thus it is throwing Exceptions.
It seems like the app process is killed when permission is changed and thus Activity is recreated.
09-24 14:42:55.071: E/AndroidRuntime(12918): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
09-24 14:42:55.071: E/AndroidRuntime(12918): Caused by:
java.lang.NullPointerException: Attempt to write to field 'int android.support.v4.app.Fragment.mNextAnim' on a null object reference
09-24 14:42:55.071: E/AndroidRuntime(12918): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:718)
09-24 14:42:55.071: E/AndroidRuntime(12918): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1489)
09-24 14:42:55.071: E/AndroidRuntime(12918): at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:548)
From super.onStart() from the Activity