Question

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?

Was it helpful?

Solution

I can think to one thing at this moment. Are you using android:configChanges="screenSize|orientation" in the manifest for that activity to avoid recreation of the list/adapter ?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top