Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ask again for permission if it was denied in android

How user denies then the dialog box never pops up again, this is the code I use:

ActivityCompat.requestPermissions(MainActivity.this,new String[]{ Manifest.permission.WRITE_EXTERNAL_STORAGE}, PackageManager.PERMISSION_GRANTED);

Could somebody give me some help please as to how make the dialog pops up again? Thanks in advance.

like image 681
new_project Avatar asked Sep 12 '25 13:09

new_project


1 Answers

Ok, turns out android 11 only asks for permission twice, as opposed to previous versions that ask over and over again (this is what I was expecting from the beginning, hence the confusion as to why the function works only two times).

like image 117
new_project Avatar answered Sep 15 '25 04:09

new_project