fix permission

androidx
Ztiany 5 years ago
parent 2b583cff1c
commit c33d0bf3c7
  1. 3
      lib_base/src/main/java/com/android/base/permission/AutoPermissionFragment.java
  2. 1
      lib_base/src/main/java/com/android/base/permission/AutoPermissionRequester.java

@ -41,7 +41,6 @@ public class AutoPermissionFragment extends Fragment {
@Override @Override
public void onPause() { public void onPause() {
super.onPause(); super.onPause();
mHandler.removeCallbacks(mRunnable);
mIsActivityReady = false; mIsActivityReady = false;
} }
@ -67,6 +66,7 @@ public class AutoPermissionFragment extends Fragment {
} }
void startRequest() { void startRequest() {
Timber.d("startRequest() called ");
mHandler.removeCallbacks(mRunnable); mHandler.removeCallbacks(mRunnable);
startChecked(); startChecked();
} }
@ -78,6 +78,7 @@ public class AutoPermissionFragment extends Fragment {
if (callback != null) { if (callback != null) {
callback.onReady(); callback.onReady();
} }
mCallback = null;
mHandler.removeCallbacks(mRunnable); mHandler.removeCallbacks(mRunnable);
} else { } else {
mHandler.postDelayed(mRunnable, 300); mHandler.postDelayed(mRunnable, 300);

@ -140,6 +140,7 @@ public class AutoPermissionRequester {
@Override @Override
public void onResume(@NonNull LifecycleOwner owner) { public void onResume(@NonNull LifecycleOwner owner) {
mActivity.getLifecycle().removeObserver(this); mActivity.getLifecycle().removeObserver(this);
Timber.d("startRequest 2");
startRequestInternal(supportFragmentManager, fragment); startRequestInternal(supportFragmentManager, fragment);
} }
}; };

Loading…
Cancel
Save