RuntimePermission icon indicating copy to clipboard operation
RuntimePermission copied to clipboard

FragmentManager is already executing transactions

Open ArmChilingarov opened this issue 4 years ago • 7 comments

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 .

ArmChilingarov avatar Aug 12 '19 10:08 ArmChilingarov

The same issue.

tim4dev avatar Aug 24 '19 09:08 tim4dev

I have faced this issue too

Nghicv avatar Sep 30 '19 05:09 Nghicv

https://github.com/florent37/RuntimePermission/pull/30 fixed this issue , please check the pr

ArmChilingarov avatar Nov 08 '19 13:11 ArmChilingarov

RxPermissions already got over this issue here https://github.com/tbruyelle/RxPermissions/issues/214

3mph4515 avatar Nov 29 '19 13:11 3mph4515

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.

3mph4515 avatar Nov 29 '19 13:11 3mph4515

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.

iamsr avatar Dec 19 '19 06:12 iamsr

hi kid

mosentest avatar Jan 16 '20 02:01 mosentest