Sub Globals
Dim a As Int
Dim b As Int
Dim c As Int
Dim d As Int
Dim spinner1 As Spinner
Dim list1 As List : list1.initialize
Dim radiobutton1 As RadioButton
Dim radiobutton2 As RadioButton
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("mylayout")
list1.AddAll(Array As String("item1","item2", "item3", "item4", "item5"))
spinner1.AddAll(list1)
End Sub
Sub radiobutton1_CheckedChange(Checked As Boolean)
End Sub
Sub radiobutton2_CheckedChange(Checked As Boolean)
End Sub
Sub spinner1_ItemClick(Position As Int, Value As Object)
item1_selected(0,"item1")
item2_selected(1,"item2")
item3_selected(2,"item3")
item4_selected(3,"item4")
item5_selected(4,"item5")
End Sub
Sub item1_selected(Position As Int, Value As Object)
a = a + 6 'This value stays the same no matter which radiobutton is checked
If radiobutton1.Checked = True Then 'These are the variables I want to change if radiobutton1 is checked
b = b - 17
c = c + 12
End If
If radiobutton2.Checked = True Then 'And these if radiobutton2 is checked
b = b + 23
d = d - 8
End If
End Sub 'The code structure is the same for the other items only the values and the variables change