Unfortunately, downloads are impossible if there
is no "external" directory.
return efd.getAbsolutePath();
}
}
+ if (!dictDir.isDirectory() && !dictDir.mkdirs()) {
+ return getApplicationContext().getFilesDir().getAbsolutePath();
+ }
return dir;
}
try {
request.setDestinationInExternalFilesDir(getApplicationContext(), null, destFile);
- } catch (IllegalStateException e) {
+ } catch (Exception e) {
request.setDestinationUri(Uri.fromFile(new File(Environment
.getExternalStorageDirectory(), destFile)));
}
dirs += "\n" + externalFilesDir;
}
}
+ File fd = getApplicationContext().getFilesDir();
+ if (fd.canWrite())
+ dirs += "\n" + fd.getAbsolutePath();
new AlertDialog.Builder(this).setTitle(getString(R.string.error))
.setMessage(getString(R.string.chosenNotWritable) + dirs)
.setNeutralButton("Close", null).show();