Change screen orientation in Android without reloading the activity Change screen orientation in Android without reloading the activity android android

Change screen orientation in Android without reloading the activity


See the edit by @luisfer. For targeting Android 3.2 and above, you need BOTH

android:configChanges="orientation|screenSize"

http://developer.android.com/guide/topics/resources/runtime-changes.html#HandlingTheChange


You need to override onSaveInstanceState(Bundle savedInstanceState) and write the application state values you want to change to the Bundle parameter


In AndroidManifest file add android:configChanges="orientation" for the activity you want to handle this orientation

In activity use onConfigurationChange overrided method. Do task you want to handle in orientation change.