Android Question (Solved) String to array using for

Douglas Farias

Expert
Licensed User
Longtime User
Hi all, i need some help with array of strings *-*

i made this to try add links at array and later put on
B4X:
GridView.ShowFromWeb(s,False)

B4X:
   Dim s() As String
    Dim Amount As Int = NotSent.Get("Amount")
    Dim Thumbnails As List = NotSent.Get("Thumbnails")
    For Each colThumbnails As Map In Thumbnails
    Dim UrlS As String = colThumbnails.Get("Url")
    For i=0 To Amount
    s = Array As String(UrlS)
    Next
    Dim PhotoID2 As String = colThumbnails.Get("PhotoID")
    Next
    GridView.ShowFromWeb(s,False)

but this add only one image

when i try to make
B4X:
    Dim Amount As Int = NotSent.Get("Amount")
    Dim Thumbnails As List = NotSent.Get("Thumbnails")
    For Each colThumbnails As Map In Thumbnails
    Dim UrlS As String = colThumbnails.Get("Url")

    Log(UrlS)

    Dim PhotoID2 As String = colThumbnails.Get("PhotoID")
    Next

this make this log
url
url
url
url
but now, how can i make to add all UrlS from loop to one array ?
 
Last edited:

Douglas Farias

Expert
Licensed User
Longtime User
Done
if help someone its here
B4X:
    Dim Amount As Int = NotSent.Get("Amount")
Dim s(Amount) As String
Dim UrlS As String

Dim i As Int

Dim Thumbnails As List = NotSent.Get("Thumbnails")
For Each colThumbnails As Map In Thumbnails
    UrlS  = colThumbnails.Get("Url")
    s(i) = UrlS
    i = i + 1
    Dim PhotoID2 As String = colThumbnails.Get("PhotoID")
    Next
Log(s)
    GridView.ShowFromWeb(s,False)
End If
 
Upvote 0
Top