Sub innerSaveState(v As View, list1 As List) Dim data() As Object If v Is Button Then 'DrP - Added button enabled status - 11JUL12 Dim btn As Button btn = v data = Array As Object(btn.Enabled) Else If v Is EditText Then Sub innerRestoreState(v As View, list1 As List) Dim data() As Object If v Is Button Then Dim btn As Button btn = v data = getNextItem(list1) btn.Enabled = data(0) Else If v Is EditText Then
Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("CreateWorkoutMain.bal") scvCreateWorkout.Panel.LoadLayout("CreateWorkout.bal") InitCreateWorkoutLayout StateManager.RestoreState(Activity, "CreateWorkout", 60) End Sub Sub Activity_Pause (UserClosed As Boolean) If UserClosed Then StateManager.ResetState("CreateWorkout") Else StateManager.saveState(Activity, "CreateWorkout") End If End Sub
Thanks Erel! That worked! Although I must admit I dont understand why it makes a difference? I mean each view has its state saved to a object list. I guess its something to do with what you ay about the checkbox view being a "special type of button".Yes. CheckBox is a special type of button. In your code you should first check for CheckBox and only then for Button.
Sub Activity_Create(FirstTime As Boolean) .... 'Load the previous state If StateManager.RestoreState(Activity, "Main", 60) = False Then 'set the default values End If End Sub Sub Activity_Pause (UserClosed As Boolean) StateManager.SaveState(Activity, "Main") End Sub