0

Here I am using different UX designs for portrait and landscape mode for a particlular activity. Created the folders layout-sw600dp and layout-sw600dp-land ,layout-sw720dp and layout-sw720dp-land for portrait and landscape mode. But the corresponding UX is not displayed while changing the mode. That is it loads the launching mode's expanded version while rotating the device. This means it will show the expanded version of landscape design while changing that to portrait. Tried the below code in the manifest. But no hope.

    android:configChanges="keyboardHidden|orientation|screenSize"
Malhotra
  • 221
  • 3
  • 13
  • THat line of code would stop the UI from changing when you rotate. Get rid of it – Gabe Sechan Oct 28 '21 at 16:11
  • @GabeSechan but by removing this code. It's reloading the activity. I want to change the UI without reloading the activity. – Malhotra Oct 28 '21 at 16:31
  • That's how changing the UI works- by restarting the activity to force it to redisplay, at which point it picks the correct resource based on the current configuration. You don't get free reloads of the UI on configuration changes if you turn off activity reset on configuration changes. You can of course do it on your own, but its a lot of work to do well. – Gabe Sechan Oct 28 '21 at 16:33

0 Answers0