Android Question get tag content

merlin2049er

Well-Known Member
Licensed User
Longtime User
I filled a listview with a query, and put the url (of that query) in that listview tag property (to remain hidden).

How do I access that tag when someone clicks on a item in listview?

What I did was ignore that tag, and run another query based on the index of that listview (which was assigned the table index) when that listview item was clicked.

I'm wondering if there is a shortcut.
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
NJDude says listviews have one tag per listview (not per item)... That's why I was returning with the same url.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
You could use AddSingleLine2 (or twolines or twolines and bitmap) and specify the URL as the data to be returned)
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
merlin maybe have a re-read of the answers regarding this in a previous thread of yours ...

ListView Values / Queries ...

If I am correct your are using AddTwoLinesAndBitmap2 to assign the Records ID to the final parameter/argument of this method so when a person clicks on this item your get the ID returned as the Click_Event value. You then use the ID to run a Query to retrieve further data / or just the URL ?? of that recordset.

If the only reason you run a Query after list click is to get the URL then why not put the URL as the return value instead of the ID , so when the list is clicked you have instant access to the URL.

B4X:
Sub ListView_ItemClick (Position As Int, Value As Object)
  
  dim recordURL as String = Value

End Sub

I have not tested but think its right ..

Cheers mj
 
Upvote 0
Top