Android Question Custom Listview methods not working after being populated

elitse

Member
I populated a customlistview from a JSON file. I added a button which was supposed to clear the custom list view and add new items, but this is not happening.

Populating a custom list view:
    ' this part works'
    MenuItems = map1.Get("bulletins")
    For i = 0 To MenuItems.Size - 1
        m = MenuItems.Get(i)
        If m.Get("callSign")="ALL" And m.Get("aircraftType")=actype Then
            lstbulletin.AddTextItem(m.Get("summary"),i)
            
        End If
            
    Next
    

Private Sub Button1_Click
    'this is not working'
    lstbulletin.Clear
    lstbulletin.AddTextItem("hi",100)
    
End Sub
 

elitse

Member
Hi Erel. Thanks for the quick reply. You were right
loading main page twice:
'TabStrip1.LoadLayout("MainPage", "Bulletins")

I had this code at the beginning. Does this mean we can't add the main page to a tabstrip view?
 
Upvote 0

elitse

Member
loading main page twice:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    B4XPages.GetManager.SetTitle(Me,"Boeing Bulletins")
    Initialize_bulletin
    
    [B]'TabStrip1.LoadLayout("MainPage", "Bulletins")[/B]
    'TabStrip1.LoadLayout("details", "Details")
    
    
    
    
End Sub

When I commented out code in bold above, problem was resolved. Thanks. I
 
Upvote 0
Top