How to forget the option "Never ask again" in the permission dialog to launch Android M

enter image description here

I want to know where the "Never ask" checkbox is stored, the boolean checkbox is checked, and how to clear its value? Not necessarily programmatically, but manually - through a setup, command, or some tool. I tried to clear the application data, uninstall how to delete and clear, I tried to manually switch the resolutions on / off back and forth, I even tried to set up a new Marshmallow image for the emulator, but no luck!

+6
source share
5 answers

Both cleansing data (Settings> Applications> your application> Storage> Clear data) and deleting the application clear the status of this flag along with clearing everything else related to the runtime permissions for the application.

This behavior has been tested on Nexus 5 running Android 6.0 through this sample application .

I seem to recall how this can be found in the manual, but I cannot find it now. This may be something that existed in the releases of M Developer Preview and was pulled out for the final version 6.0.

+8
source

You can "forget" about it by clearing the data from the application settings.

EDIT: As @me_ pointed out, simply clearing the application data cannot reset the β€œdo not ask again” condition on some devices. In such cases, manually turning on and then turning off permissions in the application settings will help.

But if you want to find out if permission is set for the second request, you can check it programmatically using the onRequestPermissionsResult() method.

 public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { for(String permission: permissions){ if(ActivityCompat.shouldShowRequestPermissionRationale(this, permission)){ //denied }else{ if(ActivityCompat.checkSelfPermission(this, permission) == PackageManager.PERMISSION_GRANTED){ //allowed } else{ //set to never ask again Log.e("set to never ask again", permission); } } } } 

PS: I answered the full implementation to this answer.

+4
source

Found:

System Settings> Applications> Reset Application Settings (in the menu)

enter image description here

+3
source

https://www.youtube.com/watch?v=F8hQfmYTEaQ

You must enable and disable permissions manually in the permissions area settings-> applications.

I tried all the suggestions on this page. None of them worked. Manual on and off returned the dialog box.

click on the YouTube post above to make sure this is the correct answer

0
source
 @Override public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { boolean dontAsk = false; if (requestCode == REQUEST_CAM_STORAGE_PERMISSION) { for (String allowedPermissions : permissions) { if (ActivityCompat.shouldShowRequestPermissionRationale(context, allowedPermissions)) { Log.e("Permission: ", "User Has Denied Permission"); } else if (PermissionChecker.checkCallingOrSelfPermission(context, allowedPermissions) != PackageManager.PERMISSION_GRANTED) { Log.e("Permission: ", "User Has Denied Permission with Don't Ask Again"); dontAsk = true; break; } else { Log.e("Permission: ", "User Has Allowed Permission"); } } if (!dontAsk) { Log.e("Permission: ", "Dont'Ask False"); checkPermission(); } else { Log.e("Permission: ", "Dont'Ask True"); startActivity(new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:" + this.getPackageName()))); } } } 
0
source

Source: https://habr.com/ru/post/1235543/


All Articles