Java tutorial
//package com.java2s; import android.content.Context; import android.provider.MediaStore; import java.io.FileNotFoundException; public class Main { public static void insertImage(Context context, String absolutePath, String name) throws FileNotFoundException { // Check if file exists with a FileInputStream MediaStore.Images.Media.insertImage(context.getContentResolver(), absolutePath, name, null); } }