문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top