Android Question View cannot be converted to customlistview

Drago Bratko

Active Member
Licensed User
Longtime User
I'm using multiple CustomListView's on the activity. Would like to address them dynamicaly and insert items on them. But I can't found a way to do it.

B4X:
For Each v As View In Activity.GetAllViewsRecursive
    If IsNumber(v.Tag) Then
        Dim clv As CustomListView = v
        clv.Add(CreateItem(v, DateTime.GetDayOfMonth(dDateToShow), "12", 0, "", True, bBlack), "")

I need Tag property of a object, as with it I know what to do with it.

On line "Dim clv as ...", compiler brakes with error :
Dim clv As CustomListView = v
javac 1.8.0_152
src\b4a\example\taskslist_mjesecno.java:586: error: incompatible types: View cannot be converted to customlistview
_clv = (b4a.example.customlistview)(_v.getObject());

Any idea how to handle that ?
 
Top