Java tutorial
//package com.java2s; import android.content.Context; import android.graphics.Bitmap; import android.net.Uri; import android.provider.MediaStore.Images; public class Main { public static final Uri getImageUri(Context inContext, Bitmap inImage) { // ByteArrayOutputStream bytes = new ByteArrayOutputStream(); // inImage.compress(Bitmap.CompressFormat.PNG, 100, bytes); String path = Images.Media.insertImage(inContext.getContentResolver(), inImage, "Title", null); return Uri.parse(path); } }