Abhinav Chauhanon Stack Overflow • Recommends
On “Android M - How to determine if the user checked "Never ask again" when denying my app's runtime permission request?”
You can check shouldShowRequestPermissionRationale() in your onRequestPermissionsResult() .
link to this video
Check whether permission was granted or not in onRequestPermissionsResult() . If not then check shouldShowRequestPermissionRationale() .
If this method returns true then show an explanation that why this particular permission is needed. Then depending on user's choice again requestPermissions() .
If it returns false then show an error message that permission was not granted and app cannot proceed further or a particular feature is disabled.
Below is sample code.
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantRes…