Friday 11 May 2012

Android: Force gallery refresh

This is a simple broadcast to force the gallery refresh instead of wait that you plug a usb cable or remount the sdcard:


 sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+
                     Environment.getExternalStorageDirectory())));
Basically  the code does a fake action and the gallery will update the pictures.

No comments:

Post a Comment