Application restart is required when user accepts READ_EXTERNAL_STORAGE permission

余生颓废 提交于 2019-12-10 23:23:27

问题


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

What is wrong with Android Pie?

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


回答1:


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)



来源:https://stackoverflow.com/questions/52006562/application-restart-is-required-when-user-accepts-read-external-storage-permissi

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