Temporary Work-Around
I was able to perform a work-around to the issue.
I believe it has something to do with when the state manager restores the state because of this senario.
Let's say we have 5 edit text boxes on the activity. The user exists from the activity and this code is run:
Sub Activity_Pause (UserClosed As Boolean)
' Save the state of the activity so everything can be re-displayed when the user comes back to this activity.
'------------------------------------------------------------------------------------------------------------
StateManager.SaveState(Activity, "People")
StateManager.SaveSettings
End Sub
At this point 5 edit text boxes are saved and I exit the app.
Now I add 2 more edit text boxes which makes 7 of them now.
When the activity is called again after starting the app you get the error because no information is saved for 7 edit text boxes because of the 2 new ones.
Sub Activity_Resume
PopulateTheListView
' Restore the state this activity was in prior to exiting it.
'------------------------------------------------------------
StateManager.RestoreState(Activity, "People", 0)
End Sub
The work-around for now is whenever you add more views like the edit text boxes is to comment out the StateManager.RestoreState line run the app and go into the activity with the new views and exit the app using the back or home button. Next un-comment the StateManager.RestoreState line and run the app going back into that same activity and the error will not happen.
Erel, can you add code in the state manager to look and handle this scenario?
Thanks.