Ciao, non riesco a capire perché quando clicco sullo spinner non esce la lista che ho inserito. Cosa non capisco?
Inoltre come faccio, dopo che l'utente seleziona un elemento dalla lista a far scaturire qualcosa?
Grazie
Spinner_test:
Sub Globals
Private Spinner1 As Spinner
End Sub
.....
Private Sub Spinner1_ItemClick (Position As Int, Value As Object)
Dim Lista1 As List
Lista1.Initialize
Lista1 = Array ("1", "2")
Spinner1.Clear
Spinner1.AddAll(Lista1)
End Sub
The spinner must be populated at the beginning of your application and not after the spinner's click event.
If it is not populated you cannot click anything, and you cannot populate only after the click ... This is nonsense
B4X:
Sub Globals
Private Spinner1 As Spinner
End Sub
Sub Activity_Create(FirstTime As Boolean)
.....
Spinner1.Clear
Spinner1.AddAll(Array ("1", "2"))
End Sub
Private Sub Spinner1_ItemClick (Position As Int, Value As Object)
log(Position)
Log(Value)
End Sub
PS. I suggest you make a small donation and become a licensed user, so we see the messages immediately and not after a few days. Risks that go unnoticed and that no one answers you