0

I have tried to use

res/layout/my_layout.xml         // layout for normal screen size ("default")
res/layout-small/my_layout.xml       // layout for small screen size
res/layout-large/my_layout.xml       // layout for large screen size
res/layout-xlarge/my_layout.xml      // layout for extra large screen size
res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape

When i launch my app it is able to see the res/layout-xlarge/my_layout.xml but when I turn the orientation (the view does turn), it doesn't show the res/layout-xlarge-land/my_layout.xml but the portrait one instead. (sorry for my bad english)

Lene
  • 519
  • 2
  • 4
  • 17

2 Answers2

2

According to the documentation xlarge resolution requires a minimum of 960dp x 720dp

http://developer.android.com/guide/practices/screens_support.html

Since you have only defined a landscape layout for xlarge, it's possible that your device does not have a large enough display to use it.

I would suggest adding

res/layout-small-land/my_layout.xml

res/layout-large-land/my_layout.xml

Additionally you can determine the size category of your device using the answer to this post:

How do I get the ScreenSize programmatically in android

Community
  • 1
  • 1
Jason Hessley
  • 1,608
  • 10
  • 8
  • I have checked and my device is neither big, small or normal. – Lene Oct 17 '12 at 03:35
  • Screen resolution is an improper method of checking resources. The Nexus 7 is 1280x800 and is NOT an xlarge screen size. It uses 'large' resources. A 10" tablet with a 1280x800 res would normally use an xlarge resource. A phone using 1280x800 res screen would likely use normal though the documentation only covers 1280x720. http://developer.android.com/tools/revisions/platforms.html – ian.shaun.thomas Oct 17 '12 at 11:22
0

Not all orientations are supported in all versions of the SDK. I could not find the information saying what SDK version xlarge-land is available in but I would bet if you change your minimum SDK version to 16 and target building to 16 it will work. Try going from there and see if you can find when it stops working.

Related: http://developer.android.com/guide/topics/resources/providing-resources.html#Compatibility

ian.shaun.thomas
  • 3,468
  • 25
  • 40
  • Here is the reason for it working in 3.2 and higher. http://developer.android.com/guide/practices/screens_support.html#DeclaringTabletLayouts – ian.shaun.thomas Oct 17 '12 at 11:24