问题
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