Question

I am creating a simple application which takes pictures using the camera intent. It works and the pictures are being saved in : storage/emulated/sd/pictures/my_folder . The problem is that I can't see those pictures from the Android Gallery app.

I saw different posts about but I couldn't find an answer. How can I watch the pictures?

Thanks

Was it helpful?

Solution

You just need to send an broadcast "ACTION_MEDIA_SCANNER_SCAN_FILE" so that the mediascanner can scan for the image you saved.

 Intent mediaScanIntent = new Intent( Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
 mediaScanIntent.setData(uri);
 sendBroadcast(mediaScanIntent);

just set the uri of the the newly created image. :)

Click to view Source :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top