Android examples for android.graphics:Bitmap Load Save
get Bitmap By Uri
import java.io.FileNotFoundException; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; public class Main { public static Bitmap getBitmapByUri(Context context, Uri uri) { Bitmap bitmap = null;/*from w w w . j av a 2 s . co m*/ try { bitmap = BitmapFactory.decodeStream(context.getContentResolver().openInputStream(uri)); } catch (FileNotFoundException e) { e.printStackTrace(); return null; } return bitmap; } }