As you can see by the code below, I save the bitmap to a public picture directory. I have also provided a screenshot of the images in storage, as further proof that the images are being saved.
The problem is that the images do not show up in the Photo app, until I reboot my phone. I have checked other apps, and those pictures show up immediately. If I open the image, I also cannot edit it (e.g. add effects) like I can other pictures.
Bitmap b = Bitmap.createScaledBitmap(mBitmap, width, height, false);
Long uuid = UUID.randomUUID().getMostSignificantBits();
File path = Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES + "/test");
if(!path.exists() && !path.isDirectory()){
path.mkdirs();
}
Log.i("Directory:", path.toString());
File file = new File(path, "test_" + uuid + ".jpg");
if (file.exists()){
file.delete();
}
FileOutputStream out = null;
try {
out = new FileOutputStream(file);
b.compress(Bitmap.CompressFormat.JPEG, 80, out);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (out != null) {
out.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
});