I have two layout files, one for landscape (layout-land) and one for portrait (layout-port). When I run my application the correct layout is grabbed initially dependent upon how I am holding my phone. If I am holding landscape, landscape is grabbed and visa versa. BUT, once I initially launch my application, if I change orientation the first layout grabbed at launch is used when switching orientation.
How do I get Android to changed layout xml per orientation change after initial launch of applicaiton?
In my manifest I have android:configChanges="orientation/key开发者_JS百科boardHidden"
When you specify configChanges in the manifest for an activity, the activity has to handle the events by itself. Either do the required layout change in the activity or remove the configChanges in the manifest.
http://developer.android.com/guide/topics/manifest/activity-element.html#config
精彩评论