Solution 1 :
The app crashes because there is an OutOfMemoryException
since loading the image into the ImageView is too large for the app to handle that.
What you need to do is to use some library that is already optimized for managing images
Try using
https://square.github.io/picasso/
or
https://github.com/bumptech/glide
To load the image into the ImageView
Problem :
In my xml code, for android development, I’m facing a problem when adding an image on screen.
my image I1
is working fine…
but problem occurs when I use image I2
in my code. I don’t know why but my app crashes when I open it using I2
image. but I’ve used I1
instead of I2
. Then it works properly.
Why it is happening …??
is there any solution….??
Comments
Comment posted by sonique
please provide crash log
Comment posted by anju jo
please check the size/resolution of the image.If it is too big app will crash