Android Question How to Re-initialize/Restart ListView?

john1in2

Member
Licensed User
Hi, I am using tabstripviewer from the excellent example.
B4X:
Private TabStrip1 As TabStrip
    Private Page3ListView1 As ListView
    Private MasterList As List        'master list of data in file
    Private DisplayList As List        'list in display format
Using the designer I created Page3 which holds Page3ListView1 as a listview

B4X:
    Activity.LoadLayout("Main")
    TabStrip1.LoadLayout("Page1", "HOME")
    Dim logo As Bitmap
    logo = LoadBitmap(File.DirAssets, "logo.png")
    Logo1.Bitmap=logo
    TabStrip1.LoadLayout("Page2", "SETTNGS")
    TabStrip1.LoadLayout("Page3", "VIEW DATA")
    
    Activity.AddMenuItem("Jump to HOME", "mnu1")
    Activity.AddMenuItem("Jump to SETTINGS", "mnu2")
    Activity.AddMenuItem("Jump to VIEW DATA", "mnu3")

Everything works great,
B4X:
for i = 1 to intenddata
Page3ListView1.AddSingleLine(strdata(i))
next

Except when the data is updated I want to redo the loop with the new data or over-write the listview with the new data- getting rid of the old data and just showing the most recent data (which includes the old data plus new items)

What happens in the listview is that I can add things to end but not start over or reinitialize it?
B4X:
Page3ListView1.Initialize
Does not seem to do anything.

How do i re-start the listview as empty?
 
Top