I have adapted some code kindly helped by 'gregwa' but i have now come across some issues which i didnt contemplate at the start....
1) When clicking an item in the list the message box is blank??
2) The list needs unique vales and sorting??
Any boffins out there wanna tell/show me how... :-(
1) When clicking an item in the list the message box is blank??
2) The list needs unique vales and sorting??
Any boffins out there wanna tell/show me how... :-(
B4X:
Sub Process_Globals
'-----------------------------
Dim WebSearch As HttpJob
'-----------------------------
Dim parser As SaxParser
End Sub
Sub Globals
Dim SiteToRead = "http://www.bishmedia.co.uk/default/Apps/xmldata.xml"
Dim ListView1 As ListView
Dim Title As String
Dim ItemSelected As String
Dim bandname As String
End Sub
Sub Activity_Create(FirstTime As Boolean)
WebSearch.Initialize("WebSearch",Me)
parser.Initialize
WebSearch.Download(SiteToRead)
Activity.LoadLayout("listviewtest")
End Sub
Public Sub JobDone (Job As HttpJob)
'-----------------------------
Dim j As InputStream
'-----------------------------
If Job.Success = True Then
j = Job.GetInputStream
parser.Parse(j, "parser")
End If
End Sub
Sub Parser_EndElement (Uri As String, Name As String, Text As StringBuilder)
If parser.Parents.IndexOf("result") > -1 Then
If Name = "bandName" Then
Title = Text.ToString
ListView1.AddSingleLine2(Title, bandname)
End If
End If
End Sub
Sub ListView1_ItemClick (Position As Int, Value As Object)
ItemSelected = Value
Msgbox(ItemSelected,"Clicked on")
End Sub