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 Jul 2, 2021. It is now read-only.
Changing existing permission in app permissions settings from Allow to Deny then returning to the activity where settings was called should call onResume.
Actual behaviour
1- After clicking the back arrow from app settings and returning to my app, it gets recreated and Logcat shows onCreate being called not onResume.
2- When I click Go to Settings from my app and change a required permission from Deny to Allow, returning to app calls onResume. This should be the same as step 1 right?
Steps to reproduce
1- Grant one permission beforehand
2- Checking multiple permission in MainActivity inside onCreate
private void checkPermissions() {
Dexter.withContext(getApplicationContext())
.withPermissions(
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_BACKGROUND_LOCATION,
Manifest.permission.SEND_SMS
).withListener(new MultiplePermissionsListener() {
@Override public void onPermissionsChecked(MultiplePermissionsReport report) {
if (report.areAllPermissionsGranted()) {
Toast.makeText(getApplicationContext(), "All permissions are granted!", Toast.LENGTH_SHORT).show();
//Continue using all app functionalities
} else if (report.isAnyPermissionPermanentlyDenied()) {
// navigating to Settings
showSettingsDialog();
} else {
Toast.makeText(getApplicationContext(), "Permissions are not granted", Toast.LENGTH_SHORT).show();
//Continue using limited app functionalities
}
}
@Override public void onPermissionRationaleShouldBeShown(List<PermissionRequest> permissions, PermissionToken token) {
token.continuePermissionRequest();
}
}).withErrorListener(new PermissionRequestErrorListener() {
@Override
public void onError(DexterError error) {
Toast.makeText(getApplicationContext(), "Error occurred! ", Toast.LENGTH_SHORT).show();
Log.e(TAG, "onError: " + error.toString() );
}
})
.onSameThread()
.check();
}
3- Deny granted permission and return using back arrows from app settings
4- Observe onCreate being called
Version of the library
6.2.1
The text was updated successfully, but these errors were encountered:
Hey @IsslamEl could you please create a repository reproducing this error? I tried to do it by myself, but I can't reproduce the error and I guess I'm missing any detail. You can fork Dexter example if you want 😃 Thank you in advance!
Hi @IsslamEl I'm afraid there is no thing we can do to help you with this issue. I do not understand why, but whenever you remove some permissions already granted, the main activity is recreated. You can check how this is not related to Dexter if you modify your code to use the following onCreate implementation:
If you do this, you'll see how after starting the app and denying the already granted permissions (you don't need Dexter to do this) the MainActivity is recreated. I'm so sorry, but I'm closing the issue now that we know there is nothing we can do to fix it in the library repository.
Thank you so much for creating the sample project.
Expected behaviour
Changing existing permission in app permissions settings from Allow to Deny then returning to the activity where settings was called should call onResume.
Actual behaviour
1- After clicking the back arrow from app settings and returning to my app, it gets recreated and Logcat shows onCreate being called not onResume.
2- When I click Go to Settings from my app and change a required permission from Deny to Allow, returning to app calls onResume. This should be the same as step 1 right?
Steps to reproduce
1- Grant one permission beforehand
2- Checking multiple permission in MainActivity inside onCreate
3- Deny granted permission and return using back arrows from app settings
4- Observe onCreate being called
Version of the library
6.2.1
The text was updated successfully, but these errors were encountered: