java.io.filenotfoundexception open failed eacces (permission denied) on device

后端 未结 11 1894
萌比男神i
萌比男神i 2020-12-08 22:03

The following code which consists of downloading a file from a server and save it in the storage works fine when the device has an internal storage.
But when I tried it

11条回答
  •  被撕碎了的回忆
    2020-12-08 22:49

    i have done very silly mistake. I have already put in AndroidManifest.xml

    
    
    

    and also add permission in java file,as get permission pragmatically. But there is mistake of Manifest.permission.READ_EXTERNAL_STORAGE. Please use Manifest.permission.WRITE_EXTERNAL_STORAGE.

    ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, requestCode);
    

提交回复
热议问题