1

I have been working with programmatic layout in Android Studio and i have a problem:

  • AVD always uses normal layout even if i use Nexus 7 which has "large" screen as its property
  • it is not code problem, since when i plug in my tablet it uses large layout and works fine

Any ideas where the problem might come from?

Ablomis
  • 157
  • 1
  • 1
  • 6

1 Answers1

0

Well you are right in some sense android should take layout dependent on different densities but some mobile do not fall under specific density. Therefore android will pick up default layout from layout directory.

to support multiple screen resolution provide different layout for different screen sizes, you can make following directories in res directory like this

layout-hdpi

layout-mdpi

layout-xhdpi

layout-xxhdpi

layout-w320dp-h408dp

layout-w480dp-h800dp


layout-w480dp-h854dp

layout-w720dp-h1280dp

layout-w1080dp-h1920dp

layout-w1440dp-h2560dp

when you provide layout in all this directories you will give multiple screen support for different sizes as well

Pankaj Nimgade
  • 4,529
  • 3
  • 20
  • 30