Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private Panel1 As Panel
Private RadioButton1 As RadioButton
Private RadioButton2 As RadioButton
Private Spinner1 As Spinner
Private ListItems1() As String = Array As String("0.5", "1", "1.5", "2", "2.5", "3")
Private ListItems2() As String = Array As String("2", "2.5", "3")
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")
RadioButton1.Checked = True
Spinner1.Clear
Spinner1.AddAll(ListItems1)
Spinner1.SelectedIndex = 0
End Sub
Sub RadioButton1_2_CheckedChange(Checked As Boolean)
Items(RadioButton1, Spinner1)
End Sub
Sub Items(rbt As RadioButton, spn As Spinner)
Dim ItemCurrent As String
Dim List1 As List
If spn.SelectedIndex > 0 Then
ItemCurrent = spn.SelectedItem
Else
ItemCurrent = ""
End If
List1.Initialize
If rbt.Checked Then
List1 = ListItems1
Else
List1 = ListItems2
End If
spn.Clear
spn.AddAll(List1)
spn.SelectedIndex = Max(spn.IndexOf(ItemCurrent), 0)
End Sub