When the orientation changes from portrait to landscape or vice versa, onCreate is called again, which makes the application start from the beginning. Make sure you handle it in the manifest by declaring android:configChanges="keyboardHidden|orientation"infront of your class name or by overriding the function onConfigChanged().
source
share