android - getExternalFilesdir Fail -


onactivitycreated i'm doing:

activity.getexternalfilesdir(environment.directory_pictures); 

in logcat get:

com.package w/contextimpl﹕ failed ensure directory: /storage/sdcard1/android/data/com.package/files/pictures 

this happens on lollipop (moto g 2014), , fine on kitkat (nexus 4). i've write_external_storage on manifest. missing here? storage mounted , reachable via file browsing app (like es explorer).

edit: surprisingly file correctly created under directory if warning reported above.

try :

string path = environment.getexternalstoragepublicdirectory(environment.directory_pictures); 

and use permission:

<uses-permission android:name="android.permission.read_external_storage" /> 

actually:

getexternalfilesdir() 

it returns path files folder inside /android/data/com.package/files/pictures on sd card. , there no folder named pictures inside it. getting error.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -