RuntimePermission
RuntimePermission copied to clipboard
FragmentManager is already executing transactions
this happens when asking permission in fragments onViewCreated method . adding some delay fixes the issue , its because , we trying add fragment when fragmentManager is already in execution .
The same issue.
I have faced this issue too
https://github.com/florent37/RuntimePermission/pull/30 fixed this issue , please check the pr
RxPermissions already got over this issue here https://github.com/tbruyelle/RxPermissions/issues/214
As far as I understand, the main idea is to use getSupportFragmentManager
if the user called permissions from an activity and to use getChildFragmentManager
if it was called from a fragment. Removing commitNowAllowingStateLoss
is just a workaround.
I face this similar problem when I was requesting the system permission e.g WRITE_SETTINGS and was having a call to code which wrapped inside ask permission on the onResume of a fragment that causes this exception to occur. Just make sure about the call you are making inside onResume in your code don't include any call to ask permission inside onResume.
hi kid