Image does not appear on HTC One M8

I am currently developing a new application for the company I am working on. We are testing this on several devices, now this is a strange thing that I noticed the other day, and someone else did.

My colleague tested the application on his HTC one m8, and we have a background image on the login page, but it did not appear to him. However, this was on the Nexus 7, Samsung Galaxy Tab 4, Motorola G and Samsung S4.

This may be very specific, but I think some people must have noticed this behavior on some devices and figured out why this could happen?

The image is saved in a regular accessible folder and has a size of 1400px933px, and this is jpeg.

I wonder if anyone has a clue.

ImageView is the first child of a relative layout with the size of the parent matching element in both width and height. Therefore, he should simply correspond, other views are on top of this.

+3
source share
3 answers

I believe this problem is also related to how android scales images. Try placing the image in the resources folder drawable-nodpi.

The folder is the drawablesame as drawable-mdpi. On images of HTC One M8, rated as mdpi, are increased by 3 times. Thus, your image 1400x933pxwill become 4200x2799px. The maximum size allowed by OpenGL is 4096x4096.

+4
source

Samsung Galaxy Note 3. , . , . . :

+2

This can be answered, but because my search brought me here, and this is likely to be for others. My xml looked like this. I was surprised to see that this is a generated application: srcCompat, because I never heard of it. I saved the code as is and copied "@ drawable / your_image" as the value for the new attribute that I added android: src.

<ImageView
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  app:srcCompat="@drawable/salwa_small"
  android:id="@+id/img_my_profile_picture"/>

After:

<ImageView
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  app:srcCompat="@drawable/salwa_small"
  android:src="@drawable/salwa_small"
  android:id="@+id/img_my_profile_picture"/>

I could see the image only in the designer of the Android studio, but after he appeared in both.

+1
source

All Articles