B4i Library [class] iStateManager - Similar to B4A StateManager

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.
 

Attachments

  • StateManager.zip
    5.2 KB · Views: 264

omidaghakhani1368

Well-Known Member
Licensed User
Longtime User
Thank you.
Erel when i open example source in b4i,get message to older version b4i.b4i version is 1.8.
Is there newer version forb4i that not email to me?
 

Yvon Steinthal

Active Member
Licensed User
Is this saved throughout an update?
I am trying to save general settings for my app without using the "apple settings app"...
 
Top