Search code examples
androidxamarin.androidandroid-textinputedittext

Text input Edit text Set Error handling Device rotation


am setting Error on an edit text for validation. However, if device is rotated then the existing style goes off and new style appears in edit text.

Is it something I need to do in OnSavedstate method or is there any work around for this..!


Solution

  • I Solved it myself here is what i have done. Decorate Activity with

    ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | 
    Android.Content.PM.ConfigChanges.ScreenSize
    

    This can prevent an Activity from being restarted when the orientation changes by setting ConfigurationChanges in the ActivityAttribute