@Override protected void onActivityResult(int requestCode, int resultCode, Intent intent) { super.onActivityResult(requestCode, resultCode, intent); if (resultCode == RESULT_OK) { Uri imageFileUri = intent.getData(); try { BitmapFactory.Options bmpFactoryOptions = new BitmapFactory.Options(); bmpFactoryOptions.inJustDecodeBounds = true; bmp = BitmapFactory.decodeStream( getContentResolver().openInputStream(imageFileUri), null, bmpFactoryOptions); bmpFactoryOptions.inJustDecodeBounds = false; bmp = BitmapFactory.decodeStream( getContentResolver().openInputStream(imageFileUri), null, bmpFactoryOptions); alteredBitmap = Bitmap.createBitmap(drawingArea.getWidth(), drawingArea.getHeight(), bmp.getConfig()); canvas = new Canvas(alteredBitmap); paint = new Paint(); paint.setColor(Color.GREEN); paint.setStrokeWidth(5); matrix = new Matrix(); canvas.drawBitmap(bmp, matrix, paint); drawingArea.cache = alteredBitmap; } catch (Exception e) { Log.v("ERROR", e.toString()); } } }