I have an Android app built on a phone that I am going to update now to also support tablet-sized screens (in particular Galaxy Tab 10.1). I figured out the whole res/layout
thing, so that's fine. However, I built my app to have a fixed screen orientation in AndroidManifest.xml
, set as android:screenOrientation="portrait"
.
Now, I want to have the following: have a fixed orientation for each screen size, the one fixed in portrait (layout-small) and the other as landscape.
Using res/layout-small-land
and res/layout-large-port
doesn't do what I want, because it still switches from portrait to landscape and back. Worse even, the app crashes when I rotate my phone to landscape, because the res/layout-small-land
doesn't exist.
Can I do this by just defining XML files, or do I have to add code?