On Android, if you revoke permission 2 times (I guess), the app cannot ever ask you again.
https://stackoverflow.com/a/36270554/10116440 tells to do this to check for permission:
if (ContextCompat.checkSelfPermission(getActivity(),
Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(getActivity(),
new String[]{Manifest.permission.RECORD_AUDIO},
REQUEST_MICROPHONE);
}
I can only compare to PackageManager.PERMISSION_DENIED
and PackageManager.PERMISSION_GRANTED
. How do I know that, if I call ActivityCompat.requestPermissions
, it will show the microphone permission popup?
I'd like to show a button for the user to go to the permission on the settings in case there's no more possibility to show the popup.