Android Question Loading layout error

JDS

Active Member
Licensed User
Longtime User
I've changed a listview to a customlistview. Changed the name from "ostatussen" to "oclv_statussen". This name doesn't exist in the application. Only at the changed view.

When I load the layout I get the error: "java.lang.RuntimeException: java.lang.RuntimeException: Field oclv_statussen was declared with the wrong type."

B4X:
lm_nietafleveren_activity_create (B4A line: 109)
Activity.LoadLayout("LM_NietAfleveren")
java.lang.RuntimeException: java.lang.RuntimeException: Field oclv_statussen was declared with the wrong type.
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
    at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
    at lmmobile.jds.android.lm_nietafleveren._activity_create(lm_nietafleveren.java:397)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
    at lmmobile.jds.android.lm_nietafleveren.afterFirstLayout(lm_nietafleveren.java:102)
    at lmmobile.jds.android.lm_nietafleveren.access$000(lm_nietafleveren.java:17)
    at lmmobile.jds.android.lm_nietafleveren$WaitForLayout.run(lm_nietafleveren.java:80)
    at android.os.Handler.handleCallback(Handler.java:815)
    at android.os.Handler.dispatchMessage(Handler.java:104)
    at android.os.Looper.loop(Looper.java:194)
    at android.app.ActivityThread.main(ActivityThread.java:5631)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
Caused by: java.lang.RuntimeException: Field oclv_statussen was declared with the wrong type.
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:431)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
    at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:148)
    ... 16 more

Any thoughts?
 

JDS

Active Member
Licensed User
Longtime User
Did change thatone as well..

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Dim oVorige As Button
    Dim oLabel2 As Label
    Dim oKIBOK As Button
    Dim KIBScannen As Button
    Dim KIBEditText As EditText
   
    Private oCLV_Statussen As CustomListView
    Private oCLV_Zendingen As CustomListView
    Private oLabel1 As Label
End Sub
 
Upvote 0

JDS

Active Member
Licensed User
Longtime User
Sorry, yes the same error occurs (oCLV_Statussen and oCLV_Zendingen) did already have the correct type in the first post.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
From the scrennshot in post #3, the CustomListView is not recognized.
If the CustomListView type were known, their color would be green.

How did you add the CustomListViews in the Designer?
Check their type there.
Otherwise post your layout file.
 
Upvote 0

JDS

Active Member
Licensed User
Longtime User
Post #3 isn't a screenshot but a piece of code within the [ code ] [ / code ] tags. Screenshot added below.
I've uploaded the two files (.bal & .bas)

In the designer it is an CustomView with the property CustomListView.

upload_2018-3-15_13-8-42.png


upload_2018-3-15_13-11-5.png
 

Attachments

  • lm_nietafleveren.bal
    7.1 KB · Views: 185
  • LM_NietAfleveren.bas
    10.3 KB · Views: 173
Upvote 0

JDS

Active Member
Licensed User
Longtime User
Okay. Got what you mean with the anchors. My way will only resize one list, the other one will stay the same in height.

I've allready tried to delete the CLV and create new ones (same names and via "Add view" and then "CustomView" > "CustomListView"). error stays the same.
 
Upvote 0
Top