Here you can find the source of getBitmapFromURI(Context context, Uri uri)
public static Bitmap getBitmapFromURI(Context context, Uri uri)
//package com.java2s; //License from project: Apache License import android.content.Context; import android.graphics.Bitmap; import android.net.Uri; import android.provider.MediaStore; import java.io.IOException; public class Main { public static Bitmap getBitmapFromURI(Context context, Uri uri) { try {/*from w w w.ja v a2 s . c o m*/ Bitmap bitmap = MediaStore.Images.Media.getBitmap( context.getContentResolver(), uri); return bitmap; } catch (IOException e) { throw new IllegalArgumentException( "Error creating bitmap from URI"); } } }