Get Bitmap from ImageView in Android L

Try this:

imageView.invalidate();
BitmapDrawable drawable = (BitmapDrawable) imageView.getDrawable();
Bitmap bitmap = drawable.getBitmap();

If you just want the Bitmap from a ImageView the following code may work for you:-

Bitmap bm=((BitmapDrawable)imageView.getDrawable()).getBitmap();

Try having the image in all drawable qualities folders (drawable-hdpi/drawable-ldpi etc.)

Could be that the emulator or device your using has a different density and is trying to pull images from another folder.

If you are using an extension in your image other than .png, .jpg, or .gif, It might not recognize other extension types. http://developer.android.com/guide/topics/resources/drawable-resource.html


According to this answer, just do it like this:

imageView.buildDrawingCache();
Bitmap bmap = imageView.getDrawingCache();

If you are trying to get bitmap from Glide loaded image then this will help you

 Drawable dr = ((ImageView) imView).getDrawable();
        Bitmap bmp =  ((GlideBitmapDrawable)dr.getCurrent()).getBitmap();