B4J Question TableView

Mikelgiles

Active Member
Licensed User
Longtime User
Is there any way to load a tableview without first loading into a list? I am worried about speed and am wondering if loading a list from disk and then moving it to tableview is slow. Am I concerned about nothing?
 

Daestrum

Expert
Licensed User
Longtime User
You don't actually have to move the data from a list to tableview. You can tell the tableview to use your list for its data.

See the setAll command for a tableview (not sure if its implemented in B4j) but can easily be done with javaobject.

eg,
B4X:
...
 asJO(tv).RunMethodJO("getItems",Null).RunMethod("setAll",Array(li))
 ' Tableview tv will now use  li list as its data
End Sub
Sub asJO(o As JavaObject) As JavaObject
 Return o
End Sub
 
Last edited:
Upvote 0
Top