Skip to content Skip to sidebar Skip to footer

Android 6.0: Sd Card Directory Creation Fails In Spite Of Having Permissions

I am trying to create an external directory structure to move some files from Device storage to SD card in Android phones. I have followed the steps given in https://developer.andr

Solution 1:

You do not have direct filesystem access to arbitrary locations on removable storage, starting with Android 4.4. WRITE_EXTERNAL_STORAGE is meaningless here, as external storage is not removable storage.

Use the Storage Access Framework (ACTION_OPEN_DOCUMENT_TREE and kin) instead. Or, limit your work to the removable storage locations returned as part of getExternalFilesDirs(), getExternalCacheDirs(), and getExternalMediaDirs() (all methods on Context).

Post a Comment for "Android 6.0: Sd Card Directory Creation Fails In Spite Of Having Permissions"