I'm loading a bitmap into an ImageView, and seeing this error. I gather this limit relates to a size limit for OpenGL hardware textures (2048x2048). The image I need to load is a pinch-zoom image of about 4,000 pixels high.
I've tried turning off hardware acceleration in the manifest, but no joy.
<application
android:hardwareAccelerated="false"
....
>
Is it possible to load an image larger than 2048 pixels into an ImageView?
Use Glide library instead of directly loading into imageview
Glide : https://github.com/bumptech/glide
Addition of the following 2 attributes in (
AndroidManifest.xml
) worked for me:I ran through same problem, here is my solution. set the width of image same as android screen width and then scales the height
This is better for any size android screen. let me know if it works for you.
Changing the image file to
drawable-nodpi
folder fromdrawable
folder worked for me.I tried all the solutions above, one-after-the-other, for quite many hours, and none seemed to work! Finally, I decided to look around for an official example concerning capturing images with Android's camera, and displaying them. The official example (here), finally gave me the only method that worked. Below I present the solution I found in that example app: