You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.
I want to apply for permission when I enter the interface,If you add this, If you click don't ask me again,it will appear !!!
There are the same problems about PermissionsDispatcher permissions-dispatcher/PermissionsDispatcher#690
private void goLogin() {
if (passNumber == null) {
passNumber = new AtomicInteger(0);
} else {
passNumber.set(0);
}
//LoginActivityPermissionsDispatcher.showCameraWithPermissionCheck(this);
rxPermissions
.requestEach(Manifest.permission.CAMERA,
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.RECORD_AUDIO,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE)
.subscribe(permission -> { // will emit 2 Permission objects
if (permission.granted) {
// permission.name is granted !
Log.i(getActivityTag(), " pass " + permission.name);
passNumber.incrementAndGet();
if (passNumber.get() == 5) {
Log.i(getActivityTag(), "all pass");
}
} else if (permission.shouldShowRequestPermissionRationale) {
Log.d(getActivityTag(), " never ask " + permission.name);
// Denied permission without ask never again
passNumber.set(0);
} else {
// Denied permission with ask never again
// Need to go to the settings
showWaringDialog();
}
});
}
I want to apply for permission when I enter the interface,If you add this, If you click don't ask me again,it will appear !!!
There are the same problems about PermissionsDispatcher
permissions-dispatcher/PermissionsDispatcher#690
@OverRide
protected void onResume() {
super.onResume();
goLogin();
}
private void goLogin() {
if (passNumber == null) {
passNumber = new AtomicInteger(0);
} else {
passNumber.set(0);
}
//LoginActivityPermissionsDispatcher.showCameraWithPermissionCheck(this);
rxPermissions
.requestEach(Manifest.permission.CAMERA,
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.RECORD_AUDIO,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE)
.subscribe(permission -> { // will emit 2 Permission objects
if (permission.granted) {
//
permission.name
is granted !Log.i(getActivityTag(), " pass " + permission.name);
passNumber.incrementAndGet();
if (passNumber.get() == 5) {
Log.i(getActivityTag(), "all pass");
}
} else if (permission.shouldShowRequestPermissionRationale) {
Log.d(getActivityTag(), " never ask " + permission.name);
// Denied permission without ask never again
passNumber.set(0);
} else {
// Denied permission with ask never again
// Need to go to the settings
showWaringDialog();
}
});
}
Logcat:
09-17 10:48:21.670 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.CAMERA
09-17 10:48:21.671 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_PHONE_STATE
09-17 10:48:21.823 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.WRITE_EXTERNAL_STORAGE
09-17 10:48:21.823 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_EXTERNAL_STORAGE
09-17 10:48:21.836 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.CAMERA
09-17 10:48:21.836 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_PHONE_STATE
09-17 10:48:22.023 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.WRITE_EXTERNAL_STORAGE
09-17 10:48:22.023 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_EXTERNAL_STORAGE
09-17 10:48:22.038 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.CAMERA
09-17 10:48:22.038 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_PHONE_STATE
09-17 10:48:22.203 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.WRITE_EXTERNAL_STORAGE
09-17 10:48:22.204 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_EXTERNAL_STORAGE
09-17 10:48:22.221 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.CAMERA
09-17 10:48:22.221 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_PHONE_STATE
09-17 10:48:22.391 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.WRITE_EXTERNAL_STORAGE
09-17 10:48:22.391 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_EXTERNAL_STORAGE
09-17 10:48:22.409 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.CAMERA
09-17 10:48:22.410 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_PHONE_STATE
09-17 10:48:22.603 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.WRITE_EXTERNAL_STORAGE
09-17 10:48:22.603 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_EXTERNAL_STORAGE
09-17 10:48:22.621 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.CAMERA
09-17 10:48:22.621 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_PHONE_STATE
09-17 10:48:22.818 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.WRITE_EXTERNAL_STORAGE
09-17 10:48:22.818 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_EXTERNAL_STORAGE
09-17 10:48:22.835 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.CAMERA
09-17 10:48:22.835 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_PHONE_STATE
09-17 10:48:23.117 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.WRITE_EXTERNAL_STORAGE
09-17 10:48:23.118 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_EXTERNAL_STORAGE
09-17 10:48:23.141 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.CAMERA
09-17 10:48:23.141 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_PHONE_STATE
09-17 10:48:23.467 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.WRITE_EXTERNAL_STORAGE
09-17 10:48:23.467 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_EXTERNAL_STORAGE
09-17 10:48:23.486 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.CAMERA
09-17 10:48:23.486 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_PHONE_STATE
09-17 10:48:23.710 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.WRITE_EXTERNAL_STORAGE
09-17 10:48:23.711 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.READ_EXTERNAL_STORAGE
09-17 10:48:23.765 27864-27864/com.rzt.newborn I/LoginActivity: pass android.permission.CAMERA
The text was updated successfully, but these errors were encountered: