Android Question Error occurred on line: 15 (B4XPages)

I'm trying to pass a list value from my app Main to B4XMainpage

On my Main I have this
B4X:
CallSub2(B4XPages.mainpage, "select_clients", list2)

And on B4XMainpage I have this code
B4X:
public Sub select_clients (title As List)
    'Autocomplete Box
    select_business_name.Setitems (title)
End Sub

But when I start my application I end up getting

java.lang.ClassCastException: java.lang.
Object cannot be cast to b4a.poslitemini.b4xpagesmanager
(Truncated)

When I remove the code line from application Main ==> CallSub2(B4XPages.mainpage, "select_clients", list2), everything works

What are my doing wrong. Thank you
 
I want to get a list of clients from a database and feed it to an autocomplete control on the login screen.
The login screen is the root.layout of B4XMainpage

I'm using CallSub2 because that is what has worked for me in the past passing values between two classes
I got the idea from here

The app begins with a splash screen which I got codes from here


This is full error

Copying updated assets files (20)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
JobName = client_select, Success = true
Error occurred on line: 15 (B4XPages)
java.lang.ClassCastException: java.lang.Object cannot be cast to b4a.poslitemini.b4xpagesmanager
at b4a.poslitemini.b4xpages._getmanager(b4xpages.java:59)
at b4a.poslitemini.b4xpages._mainpage(b4xpages.java:33)
at b4a.poslitemini.main._jobdone(main.java:607)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
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:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8587)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy (ignored)**
** Service (httputils2service) Destroy **

---------------------------------------------------------

Sometimes I get this first try of debug anytime I open the project to run

Logger connected to: R58M614VS6R
--------- beginning of system
--------- beginning of main
--------- beginning of crash
[IDE message - 10:02:42]
An error occurred.
Rapid Debugger failed to connect to process. Please try to run again.
 
Upvote 0
Top