Sub Globals
Private Spinner1 As Spinner
Dim GreenArr(2), RedArr(3),YellowArr (4)As String
Private CustomListView1 As CustomListView
Private Button1 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout1")
GreenArr(0)= "green0"
GreenArr(1)= "green1"
RedArr(0)="red0"
RedArr(1)="red1"
RedArr(2)="red2"
YellowArr(0)="yellow0"
YellowArr(1)="yellow1"
YellowArr(2)="yellow2"
YellowArr(3)="yellow3"
For i = 0 To 20
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(200,0,0,100%x,80dip)
p.LoadLayout("Layout")
CustomListView1.Add(p,i)
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub RadioButton_CheckedChange(Checked As Boolean)
Dim index As Int=CustomListView1.GetItemFromView(Sender)
Log(index)
Dim p As B4XView = CustomListView1.GetPanel(index)
If p.GetView(0).GetView(1).Checked Then
Dim s As Spinner = p.GetView(0).GetView(0)
s.Clear
s.AddAll(GreenArr)
' Log("green")
else if p.GetView(0).GetView(2).Checked Then
Dim s As Spinner = p.GetView(0).GetView(0)
s.Clear
s.AddAll(YellowArr)
' Log("yellow")
Else if p.GetView(0).GetView(3).Checked Then
Dim s As Spinner = p.GetView(0).GetView(0)
s.Clear
s.AddAll(RedArr)
' Log("Red")
End If
End Sub
Private Sub Button1_Click
StartActivity(Main)
Activity.Finish
End Sub