问题
Is there a way to get callbacks if the user revokes permissions from the settings after having granted them?
I know we have to check for permissions before trying to use a camera etc etc.
Consider the following scenario, I have a video processing application which needs permission to read and write to storage. The task of processing is usually in the order of seconds. Assuming the user gave permissions when asked and revokes them after the processing starts. In this case is there a way we can get callbacks rather than we checking each time? Just so that we can handle the error case gracefully.
回答1:
Is there a way to get callbacks if the user revokes permissions from the settings after having granted them?
No, because your process gets terminated. There is nothing to call back to.
Assuming the user gave permissions when asked and revokes them after the processing starts
In that case, your processing ends abruptly, when your process is terminated.
来源:https://stackoverflow.com/questions/32958449/android-marshmallow-callback-when-user-revokes-permissions-from-settings