I am getting following error when trying to save to external cache dir (SD card) :
java.io.FileNotFoundException:
/mnt/sdcard/Android/data/myapp/cache/files/filenamexxx.png?1385609534:
open failed: EINVAL (Invalid argument) file:filenamexxx.png?1385609534
Using following code:
File sdCard = ctx.getExternalCacheDir();
File dir = new File(sdCard.getAbsolutePath() + "/files/");
dir.mkdirs();
File file = new File(dir, mFileName);
fos = new FileOutputStream(file);
fos.write ....
But saving to device when no SD card found works fine:
fos = ctx.openFileOutput(mFileName, Context.MODE_PRIVATE);
fos.write ....
Does the ?1385609534
in the file name end mess it up, when trying to save into SD cache?
Thanks.