Month: July 2018

Android how to prevent restart the activity on orientation change.Android how to prevent restart the activity on orientation change.

For manual orientation change: [php] <activity android:name=".ActivityName" android:configChanges="orientation"/> [/php] [php] public class ActivityName extends Activity { … onStart() { setRequestedOrientation(orientation); } onConfigurationChanged(Configuration newConfig){ // do stuff for orientation change. }