I am using BottomsheetDialogFragment and recently getting crash reports on crashlytics, the stacktrace is -
Fatal Exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:2044) at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:2067) at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:680) at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:634) at android.support.v4.app.DialogFragment.dismissInternal(DialogFragment.java:205) at android.support.v4.app.DialogFragment.dismiss(DialogFragment.java:171) at com.khaalijeb.inkdrops.ListBanks.onSuccessResponse(ListBanks.java:322) at com.khaalijeb.inkdrops.App.onSuccessResponse(App.java:800) at com.olive.upi.OliveUpiManager.onSuccessResponse(Unknown Source:970) at com.olive.upi.transport.d$33.onResponse(Unknown Source:16) at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:169) at android.app.ActivityThread.main(ActivityThread.java:6595) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
I don't know what caused this error since it is not happening in some device and not all of them. Did anyone face this problem earlier and how to overcome it?
I have tested this particular code 1000 times but never got one but in the production world, I am getting this error in around 2 3 devices.
How to call commitAllowingStateLoss();? will this fixed the problem?