1. Create a layout file with a CustomListView. Make sure that the CLV is anchored to all sides:
2. Create the dialog:
B4X:
Sub Activity_Click
Dim cd As CustomLayoutDialog
cd.ShowAsync("Choose item", "", "", "", Null, False)
cd.SetSize(100%x, 100%y) 'request maximum size
Wait For Dialog_Ready (DialogPanel As Panel)
DialogPanel.LoadLayout("CustomDialogLayout")
For i = 1 To 20
CLVDialog.AddTextItem("Item #" & i, i)
Next
Wait For CLVDialog_ItemClick (Index As Int, Value As Object)
Log("Selected item: " & Value)
cd.CloseDialog(DialogResponse.POSITIVE)
End Sub
Last edited: