Sub Globals
Private lstItems As List
Private B4XComboBox2 As B4XComboBox 'need to check XUI Views Lib
Private xui As XUI
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("1") 'layout has B4XComboBox2 only
lstItems.Initialize
lstItems.AddAll(Array As String("Dog", "Cat", "Bird", "Camel", "Tiger", "Elephant"))
' 'These 3 lines works also: you can uncomment them if you want
' Dim b As B4XView=B4XComboBox2.cmbBox
' b.SetColorAndBorder(xui.Color_Red, 5dip, xui.Color_Yellow, 10dip)
' B4XComboBox2.cmbBox.DropdownBackgroundColor =xui.Color_Magenta 'works
B4XComboBox2.SetItems(lstItems)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub B4XComboBox2_SelectedIndexChanged (Index As Int)
Log(B4XComboBox2.GetItem(Index))
End Sub