I build a library for dialog for my own use. In the dialog has customlistview, when i click on the customlistview, it doesn't return the correct index, it always return the last index that i added.
2nd issue, as you can see the attachment picture. The header is not under customlistview, but when i click on the header, it did fire the customlistview_itemclick
I attach here a coding, can you let me know what am i did wrong?
i think something wrong somewhere. I did not make changes and the customlistview back to problem again. As you can see the attachment, i'm actually click on the header, but last row was selected.
1. I recommend you to use the visual designer to create the layout. It will be simpler and more flexible. You shouldn't assume that the page size is constant.
2. Never initialize an object and then assign a new object to the same variable:
B4X:
Dim m As Map: m.initialize
m = Lst.Get(i)
It should be:
B4X:
Dim m As Map = Lst.Get(i)
This code:
B4X:
Dim mDlg As Map: mDlg.Initialize
mDlg.Put("Value", "444")
mDlg.Put("Display", "444")
lstDlg.Add(mDlg)
1. I recommend you to use the visual designer to create the layout. It will be simpler and more flexible. You shouldn't assume that the page size is constant.
2. Never initialize an object and then assign a new object to the same variable:
B4X:
Dim m As Map: m.initialize
m = Lst.Get(i)
It should be:
B4X:
Dim m As Map = Lst.Get(i)
This code:
B4X:
Dim mDlg As Map: mDlg.Initialize
mDlg.Put("Value", "444")
mDlg.Put("Display", "444")
lstDlg.Add(mDlg)