This module is a port of B4A StateManager: https://www.b4x.com/android/forum/threads/9777/#content
It has two features:
1. Saving and restoring the state of UI elements.
2. Getting and setting general settings. Note that KeyValueStore class is more powerful as it supports complex objects and it persists the data automatically.
Go over the B4A tutorial to learn about the state management.
You need to call StateManager.RestoreState in Application_Start and call StateManager.SaveState in Application_Background.
For the state restoration to work the order of views must be consistent (when loading and saving the state).
Note that currently views inside ScrollView are not saved. This is related to a bug in iCore library which is fixed for the next update.
Testing
To test it run the program, play with the UI and press on the home button.
Kill the process from the IDE and restart the app (go to B4i-Bridge for this). The state should be restored.
It has two features:
1. Saving and restoring the state of UI elements.
2. Getting and setting general settings. Note that KeyValueStore class is more powerful as it supports complex objects and it persists the data automatically.
Go over the B4A tutorial to learn about the state management.
You need to call StateManager.RestoreState in Application_Start and call StateManager.SaveState in Application_Background.
For the state restoration to work the order of views must be consistent (when loading and saving the state).
Note that currently views inside ScrollView are not saved. This is related to a bug in iCore library which is fixed for the next update.
Testing
To test it run the program, play with the UI and press on the home button.
Kill the process from the IDE and restart the app (go to B4i-Bridge for this). The state should be restored.