refer to this I have test the example StateManager in B4A. I think it is useful for multi platforms B4A,B4J,and B4i. unfortunately,I'm not good at coding.
how to convert it to be B4xlib file. Who could help me to do that?
For Each v As View In Activity.GetAllViewsRecursive
If v is Button Then
Log("Press that Button! ?")
Else If v Is CheckBox Then
Log("Tick that Box! ✔️")
Else If v Is TextField Or v Is TextArea Then
Log("Write that Text! ✍️")
Else
Log("I don't recognise " & GetType(v))
End If[
Next
For Each v As View In Activity.GetAllViewsRecursive
If v is Button Then
Log("Press that Button")
Else If v Is CheckBox Then
Log("Tick that Box")
Else If v Is TextField Or v Is TextArea Then
Log("Type that Text")
Else
Log("I don't recognise " & GetType(v))
End If[
Next
You don't need to store the state of all views. If you use B4XPages, you don't even need to store anything.
Before B4XPages era, maybe you only want to store the value entered in a text field when you navigate to other activity and load this value when you return but this is no longer a thing now.