StateManager and nested views

warwound

Expert
Licensed User
Longtime User
Hi.

I've been experimenting with the StateManager - but couldn't get it to work (yet)...

I have a ScrollView that contains 5 or 6 Panels.
Each Panel contains a Label, a ToggleButton and an EditText.

It's the state of the EditTexts and ToggleButtons that i primarily want to save and restore.

So it doesn't work and i've been trying to debug it.
As far as i can tell the state is being saved in Activity_Pause and in Activity_Resume the StateManager RestoreState method is not returning False so it looks like some saved state exists and is being restored but my EditTexts and ToggleButtons state are not being restored.

I left my code exactly as it was and added a CheckBox to my layout.

Then i ran my app and hey presto the CheckBox state is saved and restored perfectly - but not my other Views!

The CheckBox parent is the Activity.

The EditTexts and ToggleBoxes parent is their containing Panel and that Panel's parent is the ScrollView Panel.

Is the problem that StateManager isn't finding these Views as they are nested 2 layers deep?

My project is attached.

Thanks.

Martin.
 

Attachments

  • StateManagerCode.zip
    6.9 KB · Views: 228
Cookies are required to use this site. You must accept them to continue using the site. Learn more…