Sub Activity_Create(FirstTime As Boolean)
'Load the previous state
If StateManager.RestoreState(Activity, "Main", 60) = False Then
'set the default values
EditText1.Text = "Default text"
EditText2.Text = "Default text"
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
If UserClosed Then
StateManager.ResetState("Main")
Else
StateManager.SaveState(Activity, "Main")
End If
StateManager.SaveSettings
End Sub
Sub SaveTemplateButton_Click
StateManager.SaveState(Activity, "Main-Template1")
End Sub
Sub LoadTemplateButton_Click
If StateManager.RestoreState(Activity, "Main-Template1", 0) = False Then
' show error toast of some kind or ignore
End If
End Sub