B4J Question Error when load a layout.

netsistemas

Active Member
Licensed User
This error:
java.lang.ClassCastException: class sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to class java.lang.Class (sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl and java.lang.Class are in module java.base of loader 'bootstrap')
are returned when i do a loadlayot and the listview var are type B4XView, if definie like ListView are ok, but i need doit this because are usen B4A thecnic.
This is my first mini proyect for B4J AN B4A

In layout only have a listview control


B4X:
Sub Class_Globals
    Private Root As B4XView 'ignore
    Private xui As XUI 'ignore

    Private ListView1 As B4XView
End Sub


'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    'load the layout to Root
    'ERROR WHEN DO THIS:' I LayoutNotas i have only a listview control
    Root.LoadLayout("LayoutNotas")
    
End Sub
 
Top