Android Question Spinner View doesn't fire Click Event

Wosl

Member
Hello All!

As a beginner I'm going to test and understand different views at the moment. This time I tried to create a simple ComboBox (Spinner).
Test Sample for Spinner:
Sub Globals
    Private ComboBoxDays As Spinner
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Dim Days() As String
'  Fill list with text
    Days = Array As String("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
'  Create ComboBox with text
    ComboBoxDays.initialize("")
    Activity.AddView(ComboBoxDays, 50dip, 200dip, 300dip, 90dip)
    ComboBoxDays.Color=Colors.DarkGray
    ComboBoxDays.TextSize=32
    ComboBoxDays.TextColor=Colors.White
    ComboBoxDays.AddAll(Days)
End Sub

Sub ComboBoxDays_ItemClick (Position As Int, Value As Object)
    Log ("Clicked Position: " & Position)
End Sub

When clicking on an item my expectation is that the event routine will be called and should log the click position. But it doesn't. The "item_click" routine is never called.

I suppose it's a rather simple mistake from myside but I couldn't find it ;-(( Any help is highly appreciated.

Wosl
 

Wosl

Member
Hi,

Yes, indeed ;-)) I felt that it's an obvious mistake but could not get it. Thank you very much for your fast response. Now it works!

Wolf
 
Upvote 0
Top