I have this code which is part of picture capturing I'm making:
private File createTemporaryFile(String part, String ext) throws Exception {
File tempDir= Environment.getExternalStorageDirectory();
//Solution I found in another question:
//File tempDir = super.getFilesDir();
tempDir=new File(tempDir.getAbsolutePath()+"/.temp/");
if(!tempDir.exists()) {
tempDir.mkdirs();
}
return File.createTempFile(part, ext, tempDir);
}
It used to work well, but now for some unknown reason it gives me a "Permission Denied" exception to the createTempFile
method. So I tried a solution I found here, and Whenever I capture the image in the startActivityForResult
activity, it proccesses the image forever. Anyone has an idea why it stopped working out of the blue or how to fix it?
Edit: I thought it might be a problem with my device, it wasn't. It's the same in another device.