I run in the simulator is normal, prove that the code is no problem,
Dynamic application code below,
Try {
String [] PERMISSIONS_STORAGE={
"Android. Permission. READ_EXTERNAL_STORAGE" and "android. Permission. WRITE_EXTERNAL_STORAGE"
};
Int permission=ActivityCompat. CheckSelfPermission (activity, "android. Permission. WRITE_EXTERNAL_STORAGE"); If (permission!=PackageManager. PERMISSION_GRANTED) {ActivityCompat. RequestPermissions (activity, PERMISSIONS_STORAGE REQUEST_EXTERNAL_STORAGE); }} the catch (Exception e) {the d (TAG, "verifyStoragePermissions: access failure" + e); }
An error as below
File: Java. IO. FileNotFoundException:/storage/emulated/0/1. TXT: open failed: EACCES (Permission denied)
I also tried to phone open storage access permissions manually, or not
I use the android studio3, plus the android injected. TestOnly=false
Manifests the china-canada
Hope to be able to solve, thank you for your
CodePudding user response:
The