B4J Question Beta 4.2 Class Cast Exception

stevel05

Expert
Licensed User
Longtime User
java.lang.RuntimeException: java.lang.ClassCastException: b4j.example.listcontrol cannot be cast to anywheresoftware.b4a.ObjectWrapper

OK I've done it again. This time I've stripped everything out of the project.

The problem seems to be loading a custom view via a Layout from a class in debug mode (works in release mode).

The small project attached demonstrates.

The ListControl custom view (Which I have stripped out too) works when loaded in a layout from the main module or a Code module (Test 1). The layouts loaded in the app include some, specifically leftlayout2, that work as expected. When I try to load the in a Layout in a class (Test class) the above Class Cast Exception is thrown.

If I remove the references from the Class_Globals to ListControl1 & ListControl2 in Class Test1, the error is not thrown.
 

Attachments

  • cvtest.zip
    15.2 KB · Views: 184

stevel05

Expert
Licensed User
Longtime User
Thanks Erel, confirmed working in the released version.:)
 
Upvote 0
Top