Forum Xamarin.Forms

Xamarin.Forms Azure AAD Login Page Looses Entered User Name on Device Orientation

dinobdinob USUniversity ✭✭✭
edited June 2019 in Xamarin.Forms

I have Xamarin.Forms application that authenticates user against Azure AAD. That all works fine but on Android, device orientation looses user name on the Microsoft authentication screen.

Here I am in Portrait mode and I have entered user name

I click on Next and land on screen to enter password. If I now rotate device before entering password and clicking Sign In, I am pushed back to screen asking for user name again and the user name I entered before is lost:

This is not happening on IOS devices, only Android.

How do I prevent this from going back to user name screen on Android? My MainActivity has already ConfigChages.Orientation attribute like below:

    [Activity(Name = "my.mainactivity"
    , Label = "MyApp"
    , Icon = "@drawable/icon"
    , ConfigurationChanges = ConfigChanges.ScreenSize 
        | ConfigChanges.SmallestScreenSize 
        | ConfigChanges.ScreenLayout 
        | ConfigChanges.Orientation)]
    public class MainActivity : Xamarin.Forms.Platform.Android.FormsAppCompatActivity

Best Answer


Sign In or Register to comment.