Android Question CustomListView question

Douwe Siegersma

Member
Licensed User
Longtime User
I'm an old VB-6.0 guy and trying to get the selected item from a CustomListView.
I thought the 'Value' property would return the text of the selected item but it doesn't. It always returns "0"
It is a very simple listview with only single-line text items. Could someone give me an example of how to do this?
 

Douwe Siegersma

Member
Licensed User
Longtime User
The listbox contains the files in a directory. I tried:
B4X:
Sub SudokuLijst_ItemClick (Index As Int, Value As Object)
    Log(Index & "  -  " & Value)
    FileNaam = SudokuLijst.GetValue(Index)
End Sub

Where SudokuLijst is the CustomListView
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
I think mcqueccu is asking you how you are adding the items to customlistview. This:
SudokuLijst.AddTextItem(s, returnedvalue)
if returnedvalue is the file name, then:
B4X:
Sub SudokuLijst_ItemClick (Index As Int, Value As Object)
    Log(Index & "  -  " & Value)
    FileNaam = value
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…