How to check type of views are there in the activity? In the example,he knows that he has what type of views are.Converting .bas file to .b4xlib is just as easy as add the file as a .zip file.
To save data, there are also many alternatives such as KVS and File.WriteMap.
You may ask a new question on this.How to check type of views are there in the activity? In the example,he knows that he has what type of views are.
How to check type of views are there in the activity? In the example,he knows that he has what type of views are.
Log(GetType(v))
I'm sorry my terrible English. I don't know : Are there types of views in activity? How to code in Do while Loop of each type of views?B4X:Log(GetType(v))
you can do it like this:I'm sorry my terrible English. I don't know : Are there types of views in activity? How to code in Do while Loop of each type of views?
For Each v As View In Activity.GetAllViewsRecursive
Log(GetType(v))
Next
B4X:Log(GetType(v))
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
In example,he used that code strategy,but each view I must code all of views for supportted. (My English can't expain my thinking).Can also check for types directly eg:
B4X: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.In example,he used that code strategy,but each view I must code all of views for supportted. (My English can't expain my thinking).