when i was inserting the bitmap image to files directory, it showing file not found exception and it is showing Is a Directory.
Here is my code:
you have to create file, before writing into stream.
File mFolder = new File(getFilesDir() + "/sample");
File imgFile = new File(mFolder.getAbsolutePath() + "/someimage.png");
if (!mFolder.exists()) {
mFolder.mkdir();
}
if (!imgFile.exists()) {
imgFile.createNewFile();
}
FileOutputStream fos = null;
try {
fos = new FileOutputStream(imgFile);
bitmap.compress(Bitmap.CompressFormat.PNG,70, fos);
fos.flush();
fos.close();
} catch (IOException e) {
e.printStackTrace();
}