Sorry, this makes no sense to me.
My code is:
Line 122 is the very LAST "Return False", just before END SUB. The exception I am getting is:
This should be obvious, but not seeing it. Any suggestions would be greatly appreciated.
My code is:
B4X:
Sub LockoutCheckout( lock As Boolean ) As Boolean
If lock Then
If Starter.CheckoutIsLocked Then
Msgbox("CHECKOUT IS ALREADY RUNNING." & CRLF & CRLF & _
"This is a safetey check to protect against" & CRLF & _
"double posting of transactions." & CRLF & _
"It appears CHECKOUT is ALREADY RUNNING." & CRLF & _
"Please give this 30 seconds to complete." & CRLF & CRLF & _
"If after 30 seconds you find yourself here again" & CRLF & _
"then EXIT the EljayDelivery app" & CRLF & _
"(close all windows, or if needed power-off the tablet)" & CRLF & _
"then restart the EljayDelivery app" & CRLF & _
"and try CHECKOUT again.","CHECKOUT DOUBLE POSTING PROTECTION")
Return False
Else
Starter.CheckoutIsLocked = True
Return True
End If
Else
Starter.CheckoutIsLocked = False
End If
Return False
End Sub
Line 122 is the very LAST "Return False", just before END SUB. The exception I am getting is:
Error occurred on line: 122 (CheckOut)
java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String
at odp.eljaydelivery.checkout._lockoutcheckout(checkout.java:477)
at odp.eljaydelivery.checkout._transactionsuploaded(checkout.java:1036)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:708)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:340)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA$2.run(BA.java:328)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5376)
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:908)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
This should be obvious, but not seeing it. Any suggestions would be greatly appreciated.