Finding saved image in Android
I found this code online to save a bitmap to the internal storage in
Android, but it seems to not be saving, or I just can't find the image.
Where would this save the image, if it were to do so?
public boolean saveImageToInternalStorage(Bitmap image) {
try {
// Use the compress method on the Bitmap object to write image to
// the OutputStream
FileOutputStream fos = context.openFileOutput("desiredFilename.png",
Context.MODE_PRIVATE);
// Writing the bitmap to the output stream
image.compress(Bitmap.CompressFormat.PNG, 100, fos);
fos.close();
return true;
} catch (Exception e) {
Log.e("saveToInternalStorage()", e.getMessage());
return false;
}
}
Thanks
No comments:
Post a Comment