在多窗口中时,我的应用程序在 android N+ 中崩溃。但这发生的只有 MainActivity 是实际活动,其他活动不会崩溃。我的 MainActivity 有标签片段,其中一个有子片段,如果这是相关的,我现在不知道,但我有一个 LocationService 在后台运行。就在生成异常的下方。
java.lang.RuntimeException:
at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3421)
at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:3461)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2730)
at android.app.ActivityThread.handleRelaunchActivity (ActivityThread.java:4524)
at android.app.ActivityThread.-wrap19 (ActivityThread.java)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1479)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:154)
at android.app.ActivityThread.main (ActivityThread.java:6123)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:757)
Caused by: java.lang.IllegalStateException:
at android.support.v4.app.FragmentManagerImpl.ensureExecReady (FragmentManager.java:1956)
at android.support.v4.app.FragmentManagerImpl.execPendingActions (FragmentManager.java:2007)
at android.support.v4.app.Fragment.performStart (Fragment.java:2214)
at android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1340)
at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState (FragmentManager.java:1528)
at android.support.v4.app.FragmentManagerImpl.moveToState (FragmentManager.java:1595)
at android.support.v4.app.FragmentManagerImpl.dispatchResume (FragmentManager.java:2914)
at android.support.v4.app.FragmentController.dispatchResume (FragmentController.java:223)
at android.support.v4.app.FragmentActivity.onResumeFragments (FragmentActivity.java:509)
at android.support.v4.app.FragmentActivity.onPostResume (FragmentActivity.java:498)
at android.support.v7.app.AppCompatActivity.onPostResume (AppCompatActivity.java:172)
at android.app.Activity.performResume (Activity.java:6800)
at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3398)