diff --git a/lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java b/lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java index 126529e..4e12b92 100644 --- a/lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java +++ b/lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java @@ -119,18 +119,15 @@ public class AutoPermissionRequester { if (fragment == null) { fragment = AutoPermissionFragment.newInstance(); - mPermissionRequester = new PermissionRequester(ActFragWrapper.create(fragment), mPermissionCallback, mAskAgain, mShowTips, mPermissionUIProvider); - fragment.setRequester(getCallback()); - supportFragmentManager.beginTransaction() .add(fragment, AutoPermissionFragment.class.getName()) .commitNowAllowingStateLoss(); - } else { - fragment.setRequester(getCallback()); - mPermissionRequester = new PermissionRequester(ActFragWrapper.create(fragment), mPermissionCallback, mAskAgain, mShowTips, mPermissionUIProvider); } + fragment.setRequester(getCallback()); + mPermissionRequester = new PermissionRequester(ActFragWrapper.create(fragment), mPermissionCallback, mAskAgain, mShowTips, mPermissionUIProvider); + fragment.startRequest(); }