Android Question 2-dimensional byte arrays as return objects when populating a listview

quique

Member
Licensed User
Longtime User
Hi There!

I got a viewlist, which has 20 items, which is populated from a string array (of 20 items).

It works nice. But now I need to attach to each one of those viewlist items a byte array as the return object.

Each byte array is 8 bytes long.

I was planning to do something like
B4X:
Dim lines(20) as string
dim bytesarray(20,8) as byte
'populate these arrays
myviewlist.clear  'prepare my viewlist for showing my lines
for i=0 to 19
miviewlist.AddSingleLine(lines(i),bytesarray(i))
next

This won't fly. Problem seems to be that I cannot use my bytesarray two-dimensional array in that way (something I do in other languages).

Any suggestions or hints ?

Regards,

Enrique.
 

MarkusR

Well-Known Member
Licensed User
Longtime User
something like this?
B4X:
Private ListView1 As ListView
Type MyLine(Text As String,MyBytes(8) As Byte)

B4X:
Dim MyList(20) As MyLine
   
ListView1.Clear
For i= 1 To 20
   ListView1.AddSingleLine2(MyList(i).Text,MyList(i))
Next
 
Upvote 0

quique

Member
Licensed User
Longtime User
Thank you! Exactly right. I did search the forum, and i missed it. In my defense, I am running a fever / sore throat / virus thingy. :) Excuses ! Lame me! Thanks again!
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
get well soon :)
 
Upvote 0
Top