I've a problem with mkdirs function. See my permissions manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="xxxxxx"
android:versionCode="15"
android:versionName="3.1.1508">
<!-- Global permissions -->
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
And my code
String APP_PATH_SD_CARD = "/xxxxx";
String fullPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + APP_PATH_SD_CARD;
if(!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())){
ToastDressmup.make(this, "External SD card not mounted", 0, ToastAction.CLOSE.getValue()).show();
}
try {
File dir = new File(fullPath);
if (!dir.exists()) {
dir.mkdirs();
}
==> My file doesn't exist
SD card is mounted. I don't understand. I read very answers on internet, but it's still wrong.
I was tested on emulator (with emulated sdcard) and on Nexus 5, it's doesn't work. On my HTC One X it's work, why ?! I'me desperate
Thank you for all! G.