用户接受READ_EXTERNAL_STORAGE权限时,需要重新启动应用程序 [英] Application restart is required when user accepts READ_EXTERNAL_STORAGE permission

查看:596
本文介绍了用户接受READ_EXTERNAL_STORAGE权限时,需要重新启动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户接受READ_EXTERNAL_STORAGE权限时,该权限被成功授予(可以在调试中看到).但是在重新启动应用程序之前,无法读取目录(调试中的dir.canRead()false).

When user accepts READ_EXTERNAL_STORAGE permission, the permission is granted successfully (it can be seen in debug). But the directory can't be read (dir.canRead() is false in debug) until the app is restarted.

minSdkVersion 24
targetSdkVersion 28

Android Pie有什么问题?

What is wrong with Android Pie?

P.S.我绝对可以确保我的代码是正确的(这是请求权限的一部分,等等)

P.S. I'm absolutely sure that my code is written right (this part of asking for permission etc.)

推荐答案

我遇到了同样的问题,但是在Pixels的正式发行版中,它已经得到解决,因此该错误仅在模拟器上发生(可能是由于他们仍然有一个Beta图片)

I had the same problem, but with the official release on Pixels it has been solved, so the bug was happening only on emulators (probably due to the fact that they have still a beta image)

这篇关于用户接受READ_EXTERNAL_STORAGE权限时,需要重新启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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