聊天页面相机调用闪退
java.lang.IllegalStateException: Fragment no longer exists for key f#0: unique id 2cda49fd-2b43-4015-823c-366cbe3a9a8c
at androidx.fragment.app.FragmentManagerImpl.getFragment(FragmentManagerImpl.java:365)
at androidx.viewpager2.adapter.FragmentStateAdapter.restoreState(FragmentStateAdapter.java:549)
at androidx.viewpager2.widget.ViewPager2.restorePendingState(ViewPager2.java:350)
at androidx.viewpager2.widget.ViewPager2.dispatchRestoreInstanceState(ViewPager2.java:375)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3892)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3892)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3892)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3892)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3892)
at android.view.View.restoreHierarchyState(View.java:19983)
at com.android.internal.policy.PhoneWindow.restoreHierarchyState(PhoneWindow.java:2162)
at android.app.Activity.onRestoreInstanceState(Activity.java:1602)
at android.app.Activity.performRestoreInstanceState(Activity.java:1557)
at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1354)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3348)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7560)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
没有找到相关结果
1 个回复
转角45°、嫣然一笑
看你的报错信息是和viepager有关的,你检查下你的viewpager设置,或者可以百度搜搜你的这个报错信息。
这个百度搜的:https://www.oschina.net/question/733242_2143202