tbruyelle / RxPermissions

Android runtime permissions powered by RxJava2
Apache License 2.0
10.48k stars 1.31k forks source link

Crash with java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState #125

Closed lovetomatoo closed 7 years ago

lovetomatoo commented 7 years ago

Log: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1413) at android.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1431) at android.app.BackStackRecord.commitInternal(BackStackRecord.java:693) at android.app.BackStackRecord.commit(BackStackRecord.java:669) at com.tbruyelle.rxpermissions.RxPermissions.getRxPermissionsFragment(RxPermissions.java:50) at com.tbruyelle.rxpermissions.RxPermissions.(RxPermissions.java:38) at com.maimiao.live.game.ui.activity.SplashActivity.toPushSetting(SplashActivity.java:111) at com.maimiao.live.game.presenter.SplashPresenter.lambda$delayStartAct$0(SplashPresenter.java:72) at com.maimiao.live.game.presenter.SplashPresenter.access$lambda$0(SplashPresenter.java:0) at com.maimiao.live.game.presenter.SplashPresenter$$Lambda$1.run(Unknown Source) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5438) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)

crash in my splash activity ,i'm press home key when i start splashactivity...eeee  sometimes  boooom
i guess because this method: getRxPermissionsFragment() used fragmentManager.commit but not commitAllowingStateLoss(). but i'm can't resolve it, because the methed is private.

help!!!!!!!

tbruyelle commented 7 years ago

Ow I think there's a PR for that... #121

tbruyelle commented 7 years ago

You probably do something wrong with your fragment usage to have this exception, anyway, version 0.9.2 now perform commitAllowingStateLoss.

lovetomatoo commented 7 years ago

I use 0.9.1, so the problem occurred.Upgrade now. thank you !!

thirtyyuan commented 6 years ago

Why perform 'commitNow()' again at version 0.10.2 ? And how can I fix it?

lovetomatoo commented 6 years ago

@thirtyyuan 你可以不用这个版本,虽然这不是一个很好的方案。

RangerAnan commented 6 years ago

刚升级到0.10.2,然而又要降下去。。。

andansky commented 5 years ago

Why perform 'commitNow()' again at version 0.10.2 ? And how can I fix it?

yyzl0418 commented 4 years ago

@tbruyelle version 0.12 java.lang.IllegalStateException Can not perform this action after onSaveInstanceState com.tbruyelle.rxpermissions3.RxPermissions.getRxPermissionsFragment(RxPermissions.java:78)