问题
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
回答1:
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 :)
来源:https://stackoverflow.com/questions/19795841/android-camera-intent-not-saving-in-gallery