Android Question CustomListView

theladygeneral

Member
Licensed User
Longtime User
Hello
I have a question, please dont send me to a tutorial, been there done that.
I used designer for layout
all on one layout
clv1 customlistview
edtin edittext
bntin button
lblout label

i use AddTextItem to populate clv1

my question is how to get text values out of clv1

for example click on item in clv1 and populate lblout

thank you
 
I assume that you are using xCustomListView.

Option 1: Set the value parameter in AddTextItem to be the same as the text parameter.
And then:
Code: Copy
Sub CLV_ItemClick (Index As Int, Value As Object)
 lbl1.Text = Value
End Sub

Option 2:
Code: Copy
Sub CLV_ItemClick (Index As Int, Value As Object)
 lbl1.Text = clv1.GetPanel(Index).GetView(0).Text 'the label is the first (and only) view in the item's panel.
End Sub
 
Upvote 0
Change this Sub .. you were passing the EditText object as value
Code: Copy
Sub bntin_Click
    clv1.AddTextItem(edtin.Text, edtin.Text)  'pass the text property of the EditText ...
    edtin.Text=""  
End Sub
 
Upvote 0
Back
Top