Listview doesn't get focus..? [SOLVED]
Hello everyone. I'm pretty new with this thing, thou I've done my share with VB and VB.NET in my younger years.
I tried to do a small program that uses custom listview2 object (from a library) for richtext/string support.
My program worked just fine when I used normal listview, but as I had to add the listview2 element(s) by code, I cannot get the object to get any touch or click events no matter how I try.
Currently I have this snip of code in my activity sub:
and this later on in the same sub:
In my "Main" layout I only have some buttons which control the information added to the listview elements. They work fine and get the focus and click events normally.
I have tried to add the listview2 elements to activity instead of pnlmain, but the result is the same. They will show up, but don't interract (trigger click events nor touch/scroll).
I've been trying to solve this for 3 hours now while reading the tutorials and documents and forum, no luck.
Any help would be greatly appreciated.
(All the listview elements are declared in the "sub globals")
Hello everyone. I'm pretty new with this thing, thou I've done my share with VB and VB.NET in my younger years.
I tried to do a small program that uses custom listview2 object (from a library) for richtext/string support.
My program worked just fine when I used normal listview, but as I had to add the listview2 element(s) by code, I cannot get the object to get any touch or click events no matter how I try.
Currently I have this snip of code in my activity sub:
B4X:
Sub Activity_Create(FirstTime As Boolean)
If FirstTime=True Then ' Load only if first load
SetupData.Initialize
Phrases.Initialize
Phrases2.Initialize
PhraseGroup.Initialize
' *************** Initialize Main Screen **************************
PnlMain.initialize("")
PnlMain.Visible=True
Activity.AddView(PnlMain, 0, 0, 100%x, 100%y)
PnlMain.LoadLayout("Main") ' Load the Mainscreen layout
and this later on in the same sub:
B4X:
' ********************** Initialize Listview elements *****************************
ListTitles.Initialize("") ' First listview element
ListPhrases.Initialize("") ' Second listview element
ListSearch.Initialize("") ' 3rd
ListNames.Initialize("") ' 4th
' ********************** Add Listview elements tp pnlMain *****************************
PnlMain.AddView(ListTitles,2%x,12%y,98%x,70%y)
' Activity.AddView(ListTitles,2%x,12%y,98%x,70%y) ' Shows, but does not get focus either?
PnlMain.AddView(ListPhrases,2%x,12%y,98%x,70%y)
PnlMain.AddView(ListSearch,2%x,12%y,98%x,70%y)
PnlMain.AddView(ListNames,2%x,12%y,98%x,70%y)
End If ' End of is it a first time load if
In my "Main" layout I only have some buttons which control the information added to the listview elements. They work fine and get the focus and click events normally.
I have tried to add the listview2 elements to activity instead of pnlmain, but the result is the same. They will show up, but don't interract (trigger click events nor touch/scroll).
I've been trying to solve this for 3 hours now while reading the tutorials and documents and forum, no luck.
Any help would be greatly appreciated.
(All the listview elements are declared in the "sub globals")
Last edited: