Android Question PermissionResult Not Firing

lip

Active Member
Licensed User
Longtime User
I have two apps, both target APK 26 and both include this code

B4X:
Sub Activity_Resume
    If Not(ExternalFilesAllowed) Then
        rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
        Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
        Log("Result = " & Result)
        ...

Sub Activity_PermissionResult (Permission As String, Result As Boolean)
        Log("PermissionResult = " & Result)    
        ...


One of the apps works fine in that if the Permission is false then the android message box pops up and asks me to allow it. However, PermissionResult does not get called (see below). I see "Result = False" in the logs but no "PermissionResult = False"

The second app shows "sending message to waiting queue (activity_permissionresult)" in the logs but again the sub does not fire but, and much more importantly, the android message is NOT displayed.

I have tried calling from different places in the app such as a btn_Click but cannot get the dial box to come up.
 

MicroDrie

Well-Known Member
Licensed User
Additional tips:
- Also note that the permission only needs to be given once. When the program is started for the second time, nothing is asked.
- When you test with the B4A-Bridge application you can discard your already given permission by clicking on the Clear data option under settings and apps under memory. Then use the project cleanup option <ctrl-p> in B4A, after which the permissions must be given again.
 
Upvote 0
Top