How to Show Activity at the time of orientation change in Android? -


When I turn the device from portrait to landscape, my activity restarts. For that activity, I need to use both portrait and landscape mode.

How to show my activity ?

Manifest file android: configChanges = "orientation | keyboardHidden" Add this line to

  & lt; Activity Activity: Name = ". Imgview" Android: configChanges = "orientation-keyboardHidden" android: label = "@ string / app_name" & gt; & Lt; Intent-Filter & gt; & Lt; Action Android: name = "android.intent.action.MAIN" /> & Lt; Category android: name = "android.intent.category.LAUNCHER" /> & Lt; / Intent-Filter & gt; & Lt; / Activity & gt;   

And where you can override to restart In my works this updated list items and some other functions have been updated: Example

  Changed the configuration on the public blank (configuration newConfig) {super.onConfigurationChanged (newConfig); Log.e ("ScreenMode" "," + ScreenMode); If (screenmode == 1) {Log.e ("ScreenMode", "" + ScreenMode); BuildUrl (Results, Start Page); ShowImageList (); } If (ScreenNode == 2) {showOneImage (forFunc); } If (screenmode == 0) {startOMG (); }}    

Comments