iOS Question Download images from website

jcesar

Active Member
Licensed User
Hi

Im trying download images from a website and insert in a CustomListView but only the last image
was displayed in listview. All the listview panels show the last image.

B4X:
Sub button_click

Dim url(7) As String
    url(0) = "http://www.der.sp.gov.br/img_cameras/name12.jpg"
    url(1) = "http://www.der.sp.gov.br/img_cameras/name11.jpg"
    url(2) = "http://www.der.sp.gov.br/img_cameras/name35.jpg"
    url(3) = "http://www.der.sp.gov.br/img_cameras/name14.jpg"
    url(4) = "http://www.der.sp.gov.br/img_cameras/name15.jpg"
    url(5) = "http://www.der.sp.gov.br/img_cameras/name28.jpg"
    url(6) = "http://www.der.sp.gov.br/img_cameras/name29.jpg"
    For i=0 To url.Length - 1
       job1.Initialize("Job1", Me)
       job1.Download(url(i))
    Next


End sub


Sub JobDone (job As HttpJob)
   
    If job.Success = True Then
        Select job.JobName
            Case "Job1", "Job2"
                clvRodovia.Add(InsertLine("Name","Description",job.GetBitmap),200dip,0)
              
        End Select
    Else
        Log("Error: " & job.ErrorMessage)
        'hd.ToastMessageShow("Error: " & Job.ErrorMessage, True)
    End If
    job.Release
End Sub
 

stevel05

Expert
Licensed User
What does the Insertline sub look like?
 

stevel05

Expert
Licensed User
But are you dimming the bitmap each time? You need a separate object for each image, or they will point to the same object.
 
Top