私はすでに On showing dialog i get "Can not perform this action after onSaveInstanceState"を表示するダイアログ
Show DialogFragment when user clicks deny on Runtime permissions dialog
この質問を読んしかし、私はまだこれをsloveする方法が知られていないのですか?誰か助けてくれますか?情報が十分ではなく、詳細であれば、私はより多くを提供します!ここで
は、エラーの完全なスタックトレースです:
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManagerImpl.java)
at android.support.v4.app.FragmentManagerImpl.popBackStackImmediate(FragmentManagerImpl.java)
at android.support.v4.app.FragmentActivity.onBackPressed(FragmentActivity.java)
at android.app.Activity.onKeyUp(Activity.java:2531)
at android.view.KeyEvent.dispatch(KeyEvent.java:2731)
at android.app.Activity.dispatchKeyEvent(Activity.java:2784)
at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java)
at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java)
at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2402)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4659)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4615)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4110)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4163)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4129)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4293)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4137)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4350)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4110)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4163)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4129)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4137)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4110)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4163)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4129)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4326)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4496)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2330)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1934)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1925)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2307)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:328)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:5769)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
とあなたが表示するようにしようとしているダイアログが、あなたが持っている必要がありますDialogFragmentある場合
ChooseSIMDialogActivityはAppCompatActivityを拡張しています。 – shuabing
はい、あなたのアクティビティから次のコードを呼び出します – thushcapone