Hi,
I load records from a server into a ListView (ListViewAffiche)
I want retrieve some elements (nom, text )of a record when I click on one line of the ListView (Sub ListViewAffiche_ItemClick) to put them in a label in another activity. How to do, what code in Sub ListViewAffiche_ItemClick
Have I to use an array? How?
I don' know if you understand well because my bad english.
Thank you
I load records from a server into a ListView (ListViewAffiche)
I want retrieve some elements (nom, text )of a record when I click on one line of the ListView (Sub ListViewAffiche_ItemClick) to put them in a label in another activity. How to do, what code in Sub ListViewAffiche_ItemClick
Have I to use an array? How?
I don' know if you understand well because my bad english.
Thank you
Sub ExecuteRemoteQuery(Query As String, JobName As String)
Dim job As HttpJob
job.Initialize(JobName, Me)
job.PostString("http://ciginfo.alwaysdata.net/connection.php", Query)
End Sub
Sub ExtraitListeAffiche
ProgressDialogShow("Extrait les données")
ExecuteRemoteQuery("SELECT id, nom, adresse, telephone, mail, longitude, latitude, ville, departement, what, texte, url, url_image, ce_moment FROM kinderbreak WHERE ce_moment = 1 ORDER BY id", AFFICHE_LIST)
End Sub
Sub JobDone(Job As HttpJob)
ProgressDialogHide
If Job.Success Then
Dim RES As String
RES = Job.GetString
Log("Response from server: " & RES)
Dim parser As JSONParser
parser.Initialize(RES)
Select Job.JobName
Case AFFICHE_LIST
Dim AFFICHE As List
AFFICHE = parser.NextArray 'returns a list with maps
For i = 0 To AFFICHE.Size - 1
Dim M As Map
M = AFFICHE.Get(i)
Dim Nom, Adresse, Telephone, Mail, Ville, Texte, URL, URL_Image As String
Dim Index,Departement, What, Ce_moment As Int
Dim Longitude, Latitude As Double
Index = M.Get("id")
Nom = M.Get("nom")
Adresse = M.Get("adresse")
Ville = M.Get("ville")
Departement = M.Get("departement")
Longitude = M.Get("longitude")
Latitude = M.Get("latitude")
Telephone = M.Get("telephone")
Mail = M.Get("mail")
What = M.Get("what")
Texte = M.Get("texte")
URL = M.Get("url")
URL_Image = M.Get("url_image")
Ce_moment = M.Get("ce_moment")
ListViewAffiche.AddTwoLines(Nom, Adresse & ", " & Ville & " " & Departement & ". Tel: " & Telephone)
Next
Sub ListViewAffiche_ItemClick (Position As Int, Value As Object)
'What I have to code here??????????????????
End Sub