0

I developed a Xamarin Forms application with a Portable Class Library. The orientation of my app is landscape. So whenever my screen goes black and I return to my app, the screen is 'reseted'. In my application, buttons change color by pressing them. Is there a possibility to save the state of the buttons, such as with the OnSaveInstanceState in Android?

NiAu
  • 535
  • 1
  • 12
  • 32

1 Answers1

1

Just follow this guide. It is pretty simple, just add

[Activity (Label = "ActivityName", ConfigurationChanges=Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize)]

above your activity :)

jdstaerk
  • 882
  • 1
  • 13
  • 30