Android Question Refreshing ULV with changes

rleiman

Well-Known Member
Licensed User
Longtime User
Hi Everyone,

In my app I display a surname and a forename in an ULV. The user can change the surname and forename in another activity.

In the app's Activity_Resume sub, what coding do I use to refresh the ULV so it will display the changes made in the other activity screen?

Currently, I'm using this code but I think it may get slow when a lot of table rows are added:

B4X:
    ULV.ClearContent
    dbCursor = Main.SQL1.ExecQuery("SELECT rowid AS TheRow, * FROM Students")
   
    For i = 0 To dbCursor.RowCount - 1
        dbCursor.Position = i
        ULV.AddItem("VIEW", dbCursor.GetLong("TheRow"))
    Next

Thanks.
 
Last edited:

BarryW

Active Member
Licensed User
Longtime User
Do not use ULV.ClearContent

Just execute again ur query

dbCursor = Main.SQL1.ExecQuery("SELECT rowid AS TheRow, * FROM Students")

then call ULV.RefreshContent it automatically refresh the content of ur list.
 
Upvote 0
Top