Spinner Problem

Fox

Active Member
Licensed User
Longtime User
Hey People following problem i have. My Spinner Should show the number of year that i save in the map in an editbox.

Here is my code:

Sub Globals
Dim Spinner2 As Spinner
Dim spinnerMap As Map
Dim Years as EditText
End sub

Sub Activity_Create(FirstTime As Boolean)
spinnerMap.Initialize
Spinner2.Add("1 Years")
spinnerMap.Put("1", "id 1")
Spinner2.Add("2 Years")
spinnerMap.Put("2", "id 2")
Spinner2.Add("3 Years")
spinnerMap.Put("3", "id 3")
End sub

Sub Spinner2_ItemClick (Position As Int, Value As Object)
Dim id As String
id = spinnerMap.Get(Value)
Years.text = spinnerMap.Get(Value)
End Sub

I get an null in my editbox.
This code not work for me where is my problem?

OK i have solved it with:

the substring in the spinner... is there an other option?
 
Last edited:
Top