I'm trying to create a general function that will do something to all instances of a specific class within a parent. I think this should work.
But it blows up with this error.
Error occurred on line: 129 (Main)
java.lang.RuntimeException: Field: ba not found in: anywheresoftware.b4a.BALayout
at anywheresoftware.b4a.shell.Shell$FieldCache.getField(Shell.java:865)
at anywheresoftware.b4a.shell.Shell.getField(Shell.java:636)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:346)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:244)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:132)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
** Activity (main) Resume **
If I do something similar with a built in view it works, such as this.
I realize the call within the class example and the call within the panel example are different but the methods are correct in their respective usage.
I'm stumped, any help appreciated.
Thanks.
B4X:
For Each Class As MyClass In PanelName
Class.Color(Colors.Blue)
Next
But it blows up with this error.
Error occurred on line: 129 (Main)
java.lang.RuntimeException: Field: ba not found in: anywheresoftware.b4a.BALayout
at anywheresoftware.b4a.shell.Shell$FieldCache.getField(Shell.java:865)
at anywheresoftware.b4a.shell.Shell.getField(Shell.java:636)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:346)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:244)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:132)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:78)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
** Activity (main) Resume **
If I do something similar with a built in view it works, such as this.
B4X:
For Each myPanel As Panel In PanelName
myPanel.Color = Colors.Blue
Next
I realize the call within the class example and the call within the panel example are different but the methods are correct in their respective usage.
I'm stumped, any help appreciated.
Thanks.
Last edited: