Android Question [B4XPages] Barcode Reader example error Sub activity_permissionresult was not found.

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Hi, I test the example and works ok.
Then I add the same modules to my firts B4Xpages app.
Modify the manifest and add the #Aditionaljar
Compile, run and when I press the barcode button , which
B4XPages.ShowPage("BarcodePage")
I get this error:

Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (splash) Resume **
java.lang.Exception: Sub activity_permissionresult was not found.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:219)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

Pic and app zip attached.
 

Attachments

  • 1.png
    1.png
    86.7 KB · Views: 178
  • Splash.zip
    36.1 KB · Views: 157

Erel

B4X founder
Staff member
Licensed User
Longtime User
You should use the comment link zipper to create the zip file, at the top of B4XMainPage.

NEVER write:

Activity.Finish
This is the splash screen implementation. It is not the B4XPages activity.

1. The error message in the screenshot is different than the error you posted.
2. I've ran your project and it works fine here.

I have a feeling that you are using an old version of RuntimePermissions. Maybe you updated it at some point and it wasn't overwritten when a new version was installed.
Check the date of RuntimePermissions.jar in the internal libraries folder. It should be from June 2020.
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Weird is that the example works ok using my actual RuntimePermissions

Error in my app is when I click on the start button to start scan.
 
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
B4A10.7 same RuntimePermissions as yours

Here goes again zip and error

Registro conectado a: samsung SM-G930F
--------- beginning of crash
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
** Activity (splash) Create, isFirst = true **
*** mainpage: B4XPage_Appear
** Activity (splash) Resume **
*** barcodepage: B4XPage_Created [mainpage]
*** mainpage: B4XPage_Disappear [mainpage]
*** barcodepage: B4XPage_Appear [mainpage]
java.lang.Exception: Sub activity_permissionresult was not found.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:219)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Zipper v1.03
Collecting files
Root: C:\b4android\SourceCode\Splash
Found 18 file(s)
Success. Zip size: 90KB
C:\b4android\SourceCode\Project.zip
Completed. Exit code: 0
 

Attachments

  • Project.zip
    89.7 KB · Views: 137
Upvote 0

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Dont know what else to do.
I had b4x 1.08 upgrade to 1.09 and sema error...
Again exmaple works ok and my app does not.
java.lang.Exception: Sub activity_permissionresult was not found.

I think in go back to b4a
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Send me your PC & smartphone, by drone šŸ˜„ :(:(:(

Open the project; "open" mBarcode B4XPage. There should be:
B4X:
Sub Class_Globals
'...
'...
#if B4A
Private rp As RuntimePermissions

and

B4X:
#if B4A
Private Sub StartCamera
    rp.CheckAndRequest(rp.PERMISSION_CAMERA)
    Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean)

Is it so?
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
I tried the last project and it work.
Clicking on Barcode and then on Start it open the camera.
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Are you able to run this last example that you attached?
 
Upvote 0
Top