Hey I've been having trouble retrieving a bitmap after I save it to a file. When I save the Bitmap:
try {
FileOutputStream file = openFileOutput("my_file", MODE_PRIVATE);
// bitmap defined elsewhere
bitmap.compress(Bitmap.CompressFormat.PNG, 100, file);
file.close();
}
catch (Exception e) {
e.printStackTrace();
}
When I try to open the file later, the image doesn't show up:
File file = new File("my_file");
imageView.setImageBitmap(BitmapFactory.decodeFile(file.getAbsolutePath()));
Would I need to use FileInputStream instead? Also will Bitmap.CompressFormat.PNG work on all image types? Any help is much appreciated.