Android Marshmallow Callback when user revokes permissions from settings ?

百般思念 提交于 2019-12-28 15:22:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!