I have a listview that is populated with a combination of text and banners. The text only lines always populate correctly. The lines that have the banners always show the last banner to get downloaded and it's link. Two questions:
How do I get it to show each banner and not the same banner over and over?
Also how do I get them to display in the correct order? Currently it shows all the text only items first then repeats the last banner the number of times a banner is present in the list.
B4X:
Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
If parser.Parents.IndexOf("item") > -1 Then
If Name = "title" Then
Title = Text.ToString
Else If Name = "link" Then
Link = Text.ToString
End If
End If
If parser.Parents.IndexOf("image") > -1 Then
If Name = "title" Then
Title = Text.ToString
Else If Name = "link" Then
Link = Text.ToString
Else If Name = "url" Then
lvImg = Text.ToString
End If
End If
If Name = "image" Then
job1.Initialize("JobGP",Me)
job1.Download(lvImg)
Return
End If
If Name = "item" Then
lvPromo.AddSingleLine2(Title, Link)
End If
End Sub
Sub JobDone (Job As HttpJob)
If Job.Success=True Then
Select Job.JobName
Case "JobGP"
lvPromo.AddTwoLinesAndBitmap2(Title, Link, Job.GetBitmap, Link)
lvPromo.TwoLinesAndBitmap.SecondLabel.Visible=False
lvPromo.TwoLinesAndBitmap.Label.Visible=False
lvPromo.TwoLinesAndBitmap.ImageView.Width=lvPromo.Width
End Select
End If
End Sub