Write application data on private directory on sdcard android 4.4 and above

前端 未结 2 1699
南笙
南笙 2021-01-25 20:38

There are many questions about this topic, but I cannot find any answers for my corrective example.

I\'m using Samsung galaxy S5 run android 4.4, which is limited for st

2条回答
  •  情歌与酒
    2021-01-25 21:22

    If getExternalFilesDir(null) is returning somewhere different to /storage/extSdCard/Android/com.myapp.example/files, then I would think that is why it is giving you access permission errors. The only place on the SD card you can write to without permissions is the directory returned by getExternalFilesDir()

    Since you say the directory returned by getExternalFilesDir(null) is not acceptable, I would suggest adding the WRITE_EXTERNAL_STORAGE permission to your manifest.

提交回复
热议问题