I’m working on an app where a table is used. On portrait it is two columns, and than on landscape three columns. I know you can use /res/layout-land folder to change the view, but then unsaved data is reset. Is there another option than using /res/layout-land/mylayout.xml?
Share
If you don want to use specific folders(like
layout-land) you could make a single layout file with theTableLayoutcontaining the three columns(all of them) and then hide/unhide one of the columns based on the current orientation of the phone. In theonCreatemethod make the collapsed column appear/disappear if the orientation is set tolandscape/portrait:I don’t know what you’re trying to achieve with this, the activity will still be recreated again as usual when the phone it’s turn.