optimize code

androidx
Zhanty 5 years ago
parent 5a9941fd13
commit 16c172345d
  1. 9
      lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java

@ -119,18 +119,15 @@ public class AutoPermissionRequester {
if (fragment == null) { if (fragment == null) {
fragment = AutoPermissionFragment.newInstance(); fragment = AutoPermissionFragment.newInstance();
mPermissionRequester = new PermissionRequester(ActFragWrapper.create(fragment), mPermissionCallback, mAskAgain, mShowTips, mPermissionUIProvider);
fragment.setRequester(getCallback());
supportFragmentManager.beginTransaction() supportFragmentManager.beginTransaction()
.add(fragment, AutoPermissionFragment.class.getName()) .add(fragment, AutoPermissionFragment.class.getName())
.commitNowAllowingStateLoss(); .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(); fragment.startRequest();
} }

Loading…
Cancel
Save