Android Question download images for listview bitmaps

a2stepper

Member
Licensed User
Longtime User
i've been trying to download lists with images to put into a listview and can get the text ok but
can not find a way to download an image and insert into ListView1.AddTwoLinesAndBitmap2 field.
any suggestion??

thanks.
paul
 

a2stepper

Member
Licensed User
Longtime User
Yes i have seed this but i want to load the image into a .bitmap to put is a listview. that loads it directly into a imageview.
thanks
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
You need to adapt the code to work for you .. In that example the image is downloaded as a '.bitmap '.

B4X:
Sub JobDone(Job As HttpJob)
   ongoingTasks.Remove(Job.JobName)
   If Job.Success Then
     Dim bmp As Bitmap = Job.GetBitmap     ' ##  heres the bitmaps...
     cache.Put(Job.JobName, bmp)
     If tasks.IsInitialized Then
       For i = 0 To tasks.Size - 1
         Dim link As String = tasks.GetValueAt(i)
         If link = Job.JobName Then
        '-------------------------------------------  ## adapt the following code to suit your listview
     
          ' Dim iv As ImageView = tasks.GetKeyAt(i)
          'iv.SetBackgroundImage(bmp)
         
          'for example         
           myListView.AddTwoLinesAndBitmap2("text1", "text2", bmp, "myReturnVal")
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…