Search code examples
androidxamarinwebviewxamarin.androidscreen-rotation

Xamarin Android WebView Automatically restart on Rotation


I am facing an issue on Xamarin Android WebView control, when I rotate my device, it automatically restart the app and get me to the url that i load onCreate. i have used android:configChanges="orientation|screenSize" in android menifest file, but issue not resolved. Please help


Solution

  • by adding this line, this issue is resolved.

        [Activity(Label = "Test App", MainLauncher = true, Icon = "@drawable/TestLogo", ConfigurationChanges = Android.Content.PM.ConfigChanges.ScreenSize | Android.Content.PM.ConfigChanges.Orientation)]