Read file in android - file permission denied

后端 未结 3 785

I want to read file from external storage. I uploaded the file in Eclipse DDMS to storage/sdcard (image below). But whenever I tried to read, I got an error of permission de

3条回答
  •  盖世英雄少女心
    2021-01-17 09:12

    I was experiencing the same problem and it can be easily removed by following either of these steps: 1. Install your app by using -g if installing on Android N and O versions. 2. Grant permission manually Settings->apps->"app_name"->Permissions->Enable Switch

    For Both steps 1 and 2, define uses-permission

    android:name="android.permission.WRITE_EXTERNAL_STORAGE" and uses-permission 
    android:name="android.permission.READ_EXTERNAL_STORAGE" in AndroidManifest.xml
    

    Like this :

    
    
    
    
        
        
        

提交回复
热议问题