0

I created a folder layout-xhdpi for particular XML for these kind of screen.

So I've the layout folder, and layout-xhdpi folder.

But when I launch the application on a phone HDPI, he gets the XML which are in layout-xhdpi folder.

I don't understand why, i missed something to do ?

Thx,

deveLost
  • 1,151
  • 2
  • 20
  • 47
  • I guess you have to create `layout-hdpi` for phone with HDPI density – yashhy Sep 30 '14 at 11:22
  • oh no..; seriously ? Android doesn't take automatically the best ressources ? The default folder is layout.. – deveLost Sep 30 '14 at 11:23
  • I have tried once, if you have XMLs in `layout` folder (alone) `hdpi` and `xhdpi` takes `layout` folder. But specifying `layout-xhdpi` folders and xmls it forced me to create `layout-hdpi` for supporting HDPI density – yashhy Sep 30 '14 at 11:26
  • Check you have the resource in the layout-hdpi folder as well, and ensure it is named *exactly* the same as the one in xhdpi. – James Sep 30 '14 at 11:26
  • So, I need to create a folder for each resolution ? Because the app need to run to in mdpi, ldpi etc... – deveLost Sep 30 '14 at 11:27
  • for your question create `layout-hdpi` folder and copy the xmls from `layout` to `layout-hdpi` it should work. – yashhy Sep 30 '14 at 11:27
  • Using density qualifiers (e.g., `-hdpi`) for anything other than a `drawable` resource directory is a serious code smell. It is almost guaranteed that you will not get what you want. – CommonsWare Sep 30 '14 at 11:53
  • But why ? I didn't read this on the developer documentation. – deveLost Sep 30 '14 at 11:58

0 Answers0