Java tutorial
//package com.java2s; import android.content.Context; import android.graphics.Bitmap; import android.net.Uri; import android.provider.MediaStore; public class Main { public static Uri getUriFromBitmap(Bitmap bitmap, Context context) { try { Uri uri = Uri .parse(MediaStore.Images.Media.insertImage(context.getContentResolver(), bitmap, null, null)); return uri; } catch (Exception e) { e.printStackTrace(); return null; } } }