0

I've a class MyClass that extends ListActivity. The list use 2 different xml for every row, depending to the device orientation:

layout-land/row_layout.xml
layout-port/row_layout.xml

I want that if the device is vertical the list will show the xml layout in the folder layout-port and if the device is horizontal the list will show the xml layout in the folder layout-land.

But this doesn't happen. My activity will always show layout-port/row_layout.xml, also after that I rotate the device from vertical to horizontal.

Should I use a particular method triggered on rotating device?

4

1 回答 1

1

此刻我能想到一件事。您是否在该活动的清单中使用 android:configChanges="screenSize|orientation" 以避免重新创建列表/适配器?

于 2013-11-13T11:23:52.063 回答