How to read Text of selected Listview.Item ?

GMan

Well-Known Member
Licensed User
Longtime User
I want to read in the text (first 8 chars are enough) from a selected, runtime-generated, item of a listview.

This should be part of a filename, that then should be read (with added extension) and opened in a textview.

Reading the file is no prob with
B4X:
EditorEditText.Text = File.ReadList (File.DirInternal ,Filename.ext)

The filename is the part i want to read in from that selected ListView.Item, the .ext will be added by code
 

Geezer

Active Member
Licensed User
Longtime User

B4X:
' whatever you pass as the first parameter will appear in your list
' whatever is 2nd parameter will be sent to the click event
list.AddSingleLine2("some text", "some more text")

Sub list_ItemClick (Position As Int, Value As Object)
 ' position is position in list
 ' Value will be whatever the 2nd parameter was
End Sub
 
Upvote 0

GMan

Well-Known Member
Licensed User
Longtime User
Yo Geezer,
you showed how to fill the listview and read the clicked item - thats no prob at all
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…