Android Question CustomListView in a TabHost

Declan

Well-Known Member
Licensed User
Longtime User
Is it possible to place a CustomListView within a TabHost?
I am doing:
B4X:
tbhMain.AddTab2("Events",clvEvents)
But error: "Types do not match"
On Compile:
B4A version: 6.30
Parsing code. (0.06s)
Compiling code. (0.35s)
Compiling layouts code. (0.02s)
Organizing libraries. (0.00s)
Generating R file. (0.18s)
Compiling debugger engine code. (4.67s)
Compiling generated Java code. Error
B4A line: 86
tbhMain.AddTab2(\
javac 1.8.0_102
src\anywheresoftware\b4a\samples\customlistview\main.java:536: error: incompatible types: customlistview cannot be converted to View
mostCurrent._tbhmain.AddTab2("Events",(android.view.View)(mostCurrent._clvevents));
^
1 error
 

Declan

Well-Known Member
Licensed User
Longtime User
Your code should be

B4X:
tbhMain.AddTab2("Events",clvEvents.AsView)
Many thanks, that works.
This is a simple "Diary" app and I will write any text entered into a SQLite database table.
In order to do this, I must be able to read the "Value".
I can do so with:
B4X:
Sub clvEvents_ItemClick(Index As Int, Value As Object)
    Log(Index & " = " & Value)
End Sub
But I must be able to read the Value from the "txtEvents_Click" event.
I tried:
B4X:
Sub txtEvents_Click(Index As Int, Value As Object)
    Log("From txtEdit: " & Value)
End Sub
But this does not work.
 
Upvote 0
Top