0

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

user1638466
  • 300
  • 1
  • 5
  • 18
  • See this http://stackoverflow.com/questions/18374140/android-newly-taken-photo-from-custom-camera-does-not-appear-in-gallery-media-s Hope this helps :) – Ankit Popli Nov 05 '13 at 18:17
  • Wow! I couldn't expect a best answer!! It worked!! There are so many posts about that I couldn't find the most useful! Thanks a lot ;) – user1638466 Nov 05 '13 at 18:24

1 Answers1

3

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 :)

Community
  • 1
  • 1
Ankit Popli
  • 2,809
  • 3
  • 37
  • 61