private void storeImage(Bitmap image) {
File pictureFile = getOutputMediaFile();
if (pictureFile == null) {
// Log.d(TAG, "Error creating media file, check storage permissions: ");// e.getMessage());
return;
}
try {
FileOutputStream fos = new FileOutputStream(pictureFile);
image.compress(Bitmap.CompressFormat.PNG, 90, fos);
fos.close();
} catch (FileNotFoundException e) {
// Log.d(TAG, "File not found: " + e.getMessage());
} catch (IOException e) {
// Log.d(TAG, "Error accessing file: " + e.getMessage());
}
}
I have used above code to save generated QR in Gallery. and it is working too.
But it is saving in Internal Storage/package_name/Files/mtImage.jpg
.
I have to go to file manager in order to view it. I want to view it directly in Gallery and I don't have any SD card.
Please help me with this.