Java tutorial
//package com.java2s; //License from project: Apache License import java.io.File; import android.content.Context; import android.content.Intent; import android.net.Uri; public class Main { public static void addImageToDeviceGallery(final Context context, final String imagePath) { final Intent mediaScanIntent = new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE"); final File f = new File(imagePath); final Uri contentUri = Uri.fromFile(f); mediaScanIntent.setData(contentUri); context.sendBroadcast(mediaScanIntent); } }