Android Question Crash on adding Custom Control in xCLV

epiCode

Active Member
Licensed User
Scenario:

Crash in module of adding items in xcustomlistview
I'm using layout to add items in xCLV ( 2 labels and 1 custom control in layout )

after creating a panel and loading the layout
exception is caused on line which refers to custom control ( LEDlabel1.text = "string..." )
however
no error on referencing other labels from layout
also
log(LEDlabel1.isinitialized) returns true

error details:

Error Log:
Error occurred on line: 496 (Main)
java.lang.RuntimeException: Object should first be initialized (Label).
Did you forget to call Activity.LoadLayout?
    at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
    at anywheresoftware.b4a.objects.ViewWrapper.setColor(ViewWrapper.java:214)
    at b4a.lib.msn.ledlabel._enabled(ledlabel.java:236)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
    at anywheresoftware.b4a.BA$2.run(BA.java:387)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6121)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
 

epiCode

Active Member
Licensed User
The error happens inside your custom view code. You need to check it and find out why the label isn't initialized.

It is not related to xCLV.
Thanks Erel !
It is resolved with your help!
Was caused due to CallSubDelayed2 not initializing until loadlayout was completed.
 
Upvote 0
Top