Android Question runtimepermissions strange behaviour

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
B4X:
        Dim rp As RuntimePermissions
        For Each permission As String In Array(rp.PERMISSION_GET_ACCOUNTS,rp.PERMISSION_READ_CONTACTS)
            rp.CheckAndRequest(permission)
            Wait For B4XPage_PermissionResult (permission As String, Result As Boolean)
            If Result = False Then
                Log(permission & " denied")
                Return
            End If
        Next
In B4XPages, above code works fine if we don't grant it, Log(permission & " denied") fired.
If we grant it and call it again, code crash & through error:
B4X:
Sub activity_permissionresult was not found.

Any explanation?
 

agraham

Expert
Licensed User
Longtime User
If this missed file was the problem only, Can you zip it & share us.
You don't need it. To be safe delete your SDK, uninstall B4A, and ensure that there are no remaining files left in the internal libraries folder and then follow the instructions exactly. It should just work and you don't need any extra files.
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
I don't like that, because I have a lot of old projects, so I don't want to enter in a collateral war here & there such us missed, maven, artifact, config, ...etc
Unluckily you would risk it anyway.
It looks like your installation has some problems.
Even if we supply you with the file you requested now then it could happen with another and another.
Your projects should be external to the B4A installation folder, as it should be the Additional Libraries.
Take the time to save all the necessary files and then start from a clean B4A install and SDK.
You won't regret it.
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Here they are.
Good Luck.
Backup what you have before overwrite.
 

Attachments

  • RuntimePermissions.androidx.jar
    3.5 KB · Views: 186
  • RuntimePermissions.jar
    3.5 KB · Views: 196
  • RuntimePermissions.xml
    7.3 KB · Views: 164
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
This is solved, OK.
The question is:
Why was your files wrong/corrupted?
The ones I sent you are just from B4A installation.
 
Upvote 0
Top