I added a listview to the customdialog and I want it to return the listview item that I click. The dialog should be closed upon selection. How to do that?
Thanks in advance..
Thanks in advance..
B4X:
Sub Globals
Dim pos As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim btn As Button
btn.Initialize("btn")
btn.Text="click me"
Activity.AddView(btn,0,0,100dip,50dip)
End Sub
Sub btn_Click
Dim i As Int
Dim lv As ListView
Dim cd As CustomDialog2
lv.Initialize("lv")
For i=0 To 99
lv.AddSingleLine("Item : " & i)
Next
cd.AddView(lv, 77%x, 70%y)
ret = cd.Show("B4A Custom Dialog", "", "OK", "", Null) + pos
Msgbox(ret,"selection")
End Sub
Sub lv_ItemClick (Position As Int, Value As Object)
pos = Position
End Sub