I have a fragment that displays a camera and, when the user clicks the main button, one photo is taken. I tried to create a path in the gallery and save images there but every time I open the gallery in my emulator, there is no folder with the images. Do you know what may be causing this problem? This is the code I have:
Code to create the path and save images
private void saveImage(Bitmap finalBitmap, String image_name) {
final String appDirectoryName = "/Feel/";
String root = Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES).toString() + appDirectoryName;
File myDir = new File(root);
myDir.mkdirs();
String fname = "Image-" + image_name + ".jpg";
File file = new File(myDir, fname);
if (file.exists()) file.delete();
Log.i("LOAD", root + fname);
try {
FileOutputStream out = new FileOutputStream(file);
finalBitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}