I am trying to build a spinner with items. the items are in a list.
(ArrayList) [[1, Brad brown, brad, PCP-IV], [2, Penny brown, penny, FR]]
When I run this code:
in my logs I get:
[1, Brad brown, brad, PCP-IV]
[2, Penny brown, penny, FR]
this is the first step, now I need to access each piece of the data in the string to build a nice looking spinner.
i.e. Brad Brown (PCP-IV)
To me this arr looks like an array, so is that how I access the items?
thanks
Brad
(ArrayList) [[1, Brad brown, brad, PCP-IV], [2, Penny brown, penny, FR]]
When I run this code:
B4X:
Sub build_user_spinner
Log("build spinner staff")
Dim mylist As List
mylist.Initialize
Dim arr() As String
mylist = File.readList(File.DirInternal,"stafflist.txt")
' set first value as action statement
Spinner1.Add("Select User")
Spinner2.Add("Select User")
For i = 0 To mylist.Size -1
arr = mylist.Get(i)
Log(arr)
Spinner1.Add(mylist.Get(1))
Spinner2.Add(mylist.Get(1))
Next
End Sub
in my logs I get:
[1, Brad brown, brad, PCP-IV]
[2, Penny brown, penny, FR]
this is the first step, now I need to access each piece of the data in the string to build a nice looking spinner.
i.e. Brad Brown (PCP-IV)
To me this arr looks like an array, so is that how I access the items?
thanks
Brad