Android Question 1D and 2D Barcode Scanner with ZXING Question for B4A


HI, Johan Schoeman, I can perfectly run your example code, but when I change it to B4XMainPage, in the zxBarcodeScanner_scan_result() function, when running the sound effect, i.e., nativeMe.RunMethod("playTone", Null) and nativeMe.RunMethod("vibrateOnce", Array(tim)), I get the following error (when I comment them out, it runs normally). I have been looking for a long time but have not been able to solve it, so I can only seek your help. Please assist me. Thank you.

Error occurred on line: 151 (B4XMainPage) java.lang.RuntimeException: Object should first be initialized (JavaObject). at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67) at anywheresoftware.b4j.object.JavaObject.getCurrentClass(JavaObject.java:259) at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:119) at b4a.example.b4xmainpage._zxbarcodescanner_scan_result(b4xmainpage.java:473) 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:157) at anywheresoftware.b4a.BA$2.run(BA.java:395) at android.os.Handler.handleCallback(Handler.java:971) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loopOnce(Looper.java:206) at android.os.Looper.loop(Looper.java:296) at android.app.ActivityThread.main(ActivityThread.java:9205) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1027)
 

Attachments

  • E.zip
    15.9 KB · Views: 6

Johan Schoeman

Expert
Licensed User
Longtime User

Click in the link above - I have posted the solution there.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…