Android Question Convert view in customlistview??

Dadaista

Active Member
Licensed User
Longtime User
Hi!!

I get this error:

B4A version: 6.00
Parsing code. (0.04s)
Compiling code. (0.10s)
Compiling layouts code. (0.03s)
Organizing libraries. (0.00s)
Generating R file. (0.64s)
Compiling debugger engine code. (1.79s)
Compiling generated Java code. Error
B4A line: 264
If v Is CustomListView Then
javac 1.8.0_66
src\b4a\example\main.java:490: error: incompatible types: View cannot be converted to customlistview
if (_v.getObjectOrNull() instanceof b4a.example.customlistview) {


The code...
B4X:
Dim panel As Panel

panel = Activity.GetView(2)

    For Each v As View In panel.GetAllViewsRecursive
        Log(v.Tag)
        If v Is CustomListView Then         'I suppose is here
            'code
        else if v Is EditText Then
            'code
        End If
    Next

How can I solved it??

thanks in advance

edit:
this also fails..
B4X:
    Dim panel As Panel
    Dim k As CustomListView

    panel = Activity.GetView(2)   
    k = panel.GetView(4)' index of customlistview
 
Last edited:

Dadaista

Active Member
Licensed User
Longtime User
Hi RauchG, thx for response.

I can't see the solution... I don't want get the items of the customlistview.

I only want to get the property tag of the customlistview because I saved there some data. With ".GetAllViewsRecursive" is not possible. The compilation fails

Never mind...... I will saved the data in another tag property of anycontrol in the panel created.
 
Upvote 0

Dadaista

Active Member
Licensed User
Longtime User
thx Erel but I don't know how to do what you said or my english is awful... or both

I don't know how to get the customlistview created in run time. my project is stopped until I can solve it

edit:
now is when I need to use .AddTextItem.... how can I get de customlistview?
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…