Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private B4XComboBox1 As B4XComboBox
Private List1 As List
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
List1.Initialize
List1.AddAll(Array As String("Apple", "Banana", "Cocoa"))
B4XComboBox1.SetItems(List1)
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Button1_Click
If B4XComboBox1.IndexOf("Cucumber") = -1 Then
List1.Add("Cucumber")
B4XComboBox1.SetItems(List1)
End If
End Sub
[code]