How to add images to gallery programmatically in android or refresh gallery programmatically???

November 03, 2016 0 Comments

So Many Times We Face the Simple Problem,

Our Image Is created and we can seen in the Filemanager but we can't check in image gallery So at that time ,

After Created Image We refresh Image which add on ImageMedia.We need for Image path,

How to Use :
private static void refreshGallery(String mCurrentPhotoPath, Context context) {
Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
File f = new File(mCurrentPhotoPath);
Uri contentUri = Uri.fromFile(f);
mediaScanIntent.setData(contentUri);
context.sendBroadcast(mediaScanIntent);
}

Contributer

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google

0 comments:

Hot-product

Best Watch Store

Popular Posts

Contact Form

Name

Email *

Message *