问题
I want my app to go from portrait to landscape and change from layout1 to layout2 but not restart the activity.
It goes from layout1 to layout2 nicely, but restarts the activity every time it switches from portrait to landscape and landscape to portrait and i want to just run the activity once then keep it there.
Any help is greatly appreciated thank you.
回答1:
You can achieve this by add android:configChanges="orientation"
to your activity in manifest and handle the screen contents manually by overriding onConfigurationChanged
来源:https://stackoverflow.com/questions/10235178/change-layouts-but-not-restart-activity-on-my-android-app