Android的棉花糖回调,当用户撤消设置权限? [英] Android Marshmallow Callback when user revokes permissions from settings ?

查看:186
本文介绍了Android的棉花糖回调,当用户撤消设置权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让回调,如果用户已经给予他们的后撤消设置权限?

我知道我们试图用相机之前,检查权限等等等等

考虑以下情形,我有需要权限读取和写入到存储设备的视频处理应用程序。处理的任务通常在秒的量级。假设用户给予权限时问及撤销他们的处理开始之后。 在这种情况下,有没有办法,我们可以得到的回调,而不是我们在检查每一次?为了让我们能够妥善处理错误情况。

解决方案
  

有没有办法让回调,如果用户已经给予他们的后撤消设置权限?

没有,因为你的进程被终止。没有什么回调。

  

假设用户给予权限时问和处理开始后,撤销其

在这种情况下,你的处理突然结束,当你的进程被终止。

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.

解决方案

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.

这篇关于Android的棉花糖回调,当用户撤消设置权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆