Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import java.io.InputStream; public class Main { public static Bitmap readBitmapFromPath(Context context, Uri path) throws Exception { InputStream stream = context.getContentResolver().openInputStream(path); Bitmap bitmap = BitmapFactory.decodeStream(stream); if (stream != null) { stream.close(); } return bitmap; } }