Mathijs Segers Mathijs Segers - 2 months ago 18
Android Question

Image not appearing on HTC One M8

I'm currently developing a new app for the company I'm working at.
We test this on multiple devices, now a strange thing I noticed the other day, well someone else did.

My Colleague tested the app on his HTC one m8, and we have a background image on the login page but it didn't show for him. It did however on a Nexus 7, Samsung Galaxy Tab 4, Motorola G and Samsung S4.

This might be very specific, but I guess some people must have noticed this kind of behaviour before on certain devices and found out why this could possibly occur?

The image is saved in the regular drawable folder and has a size of 1400px933px and it's a jpeg.

I wonder if anyone has any clue.

The ImageView is the first child of a relative layout, with a size of match parent in both width and Height. So it should just fit, other views are on top of this one.

Answer

I believe this problem is also to do with how android scales the images. Try putting the image into a drawable-nodpi resource folder.

The drawable folder is the same as drawable-mdpi. On the HTC One M8 images qualified as mdpi are scaled up by a factor of 3. So your 1400x933px image becomes 4200x2799px. The maximum size allowed by OpenGL is 4096x4096.