Search code examples
androidandroid-layoutmultiscreen

Android Layout Densities folder


I have the next problem:

I have a folder name layout (path: res/layout/...) that contains some activities. I create another folder name layout-xhdpi (path: res/layout-xhdpi/...) with the same activities. I added to the main activity inside layout-xhdpi a textView that shows "You enter in xhdpi".

The problem is that when i run the app in a Samsung S4 that is a xxhdpi, it opens the activity XHDPI, not enter to res/layout/...

Why is this happening?

Greetings


Solution

  • That's normal, layout-xhdpi will be used for xhdpi devices and higher, unless you have other layouts for bigger dpi (e.g. layout-xxhdpi). The default folder will be used for devices with lower resolution.