nibbo Active Member Licensed User Longtime User May 12, 2021 #1 Hi Wait for B4XPage_PermissionResult never comes back Below is the code which I copied from the B4XPages Bluetooth Cat example: B4X: Copy Log("Checking Permissions") rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION) Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean) Log("Permission Result = " Result) In the log I can see the 'Checking Permissions', and, if I haven't already granted permission if does actually request it. After granting permission it never returns to the 'Wait For' bit so I never see the permissions result message in the log. It doesn't crash or anything, just sits there... I do see a peculiar message (below) if I untick the filter but that does not look like it is related. Code: Copy Checking Permissions Class androidx.core.content.ContextCompat failed lock verification and will run slower. Any ideas? Thanks Last edited: May 12, 2021
Hi Wait for B4XPage_PermissionResult never comes back Below is the code which I copied from the B4XPages Bluetooth Cat example: B4X: Copy Log("Checking Permissions") rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION) Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean) Log("Permission Result = " Result) In the log I can see the 'Checking Permissions', and, if I haven't already granted permission if does actually request it. After granting permission it never returns to the 'Wait For' bit so I never see the permissions result message in the log. It doesn't crash or anything, just sits there... I do see a peculiar message (below) if I untick the filter but that does not look like it is related. Code: Copy Checking Permissions Class androidx.core.content.ContextCompat failed lock verification and will run slower. Any ideas? Thanks
KMatle Expert Licensed User Longtime User May 12, 2021 #2 Did you add the permission to the manifest? (had the same issue today) Upvote 0
nibbo Active Member Licensed User Longtime User May 12, 2021 #3 KMatle said: Did you add the permission to the manifest? (had the same issue today) Click to expand... Thanks KMatle but yes the permission is in the manifest. Not sure what B4XPage_PermissionResult is but I found another post that suggested changing it to Activity_PermissionResult and that seems to work. Upvote 0
KMatle said: Did you add the permission to the manifest? (had the same issue today) Click to expand... Thanks KMatle but yes the permission is in the manifest. Not sure what B4XPage_PermissionResult is but I found another post that suggested changing it to Activity_PermissionResult and that seems to work.
H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User May 12, 2021 #4 nibbo said: B4XPage_PermissionResult is but I found another post that suggested changing it to Activity_PermissionResult and that seems to work Click to expand... right .. delegation issue Upvote 0
nibbo said: B4XPage_PermissionResult is but I found another post that suggested changing it to Activity_PermissionResult and that seems to work Click to expand... right .. delegation issue
AnandGupta Expert Licensed User Longtime User May 13, 2021 #5 nibbo said: Not sure what B4XPage_PermissionResult is but I found another post that suggested changing it to Activity_PermissionResult and that seems to work. Click to expand... This, as I found out when making the B4XPages widget, is that if you use B4XPages then "B4XPage_PermissionResult " works, else in Activity "Activity_PermissionResult " works. Regards, Anand Upvote 0
nibbo said: Not sure what B4XPage_PermissionResult is but I found another post that suggested changing it to Activity_PermissionResult and that seems to work. Click to expand... This, as I found out when making the B4XPages widget, is that if you use B4XPages then "B4XPage_PermissionResult " works, else in Activity "Activity_PermissionResult " works. Regards, Anand
Peter Simpson Expert Licensed User Longtime User May 13, 2021 #6 nibbo said: Not sure what B4XPage_PermissionResult is but I found another post that suggested changing it to Activity_PermissionResult and that seems to work. Click to expand... If you have created a B4XPage project then you should be using the following. Code: Copy Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean) Working fine here, don't forget to add a reference that needs locations... Attachments Test.zip Test.zip 9.8 KB · Views: 281 Upvote 0
nibbo said: Not sure what B4XPage_PermissionResult is but I found another post that suggested changing it to Activity_PermissionResult and that seems to work. Click to expand... If you have created a B4XPage project then you should be using the following. Code: Copy Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean) Working fine here, don't forget to add a reference that needs locations...
nibbo Active Member Licensed User Longtime User May 14, 2021 #7 Peter Simpson said: If you have created a B4XPage project then you should be using the following. Code: Copy Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean) Click to expand... It was a B4XPage project but still Activity_PermissionResult works and B4XPage_PermissionResult does not. Not really an issue as I have abandoned B4XPage anyway and sticking with Activities... Thanks Upvote 0
Peter Simpson said: If you have created a B4XPage project then you should be using the following. Code: Copy Wait For B4XPage_PermissionResult (Permission As String, Result As Boolean) Click to expand... It was a B4XPage project but still Activity_PermissionResult works and B4XPage_PermissionResult does not. Not really an issue as I have abandoned B4XPage anyway and sticking with Activities... Thanks
Peter Simpson Expert Licensed User Longtime User May 14, 2021 #8 nibbo said: Activity_PermissionResult works and B4XPage_PermissionResult does not. Click to expand... Hello @nibbo, That's an incorrect statement that can easy put other developers off from from using B4XPages if they read it. You obviously did something incorrectly, nevertheless as long as you have got your project working that's all that really matters at the end of the day. Anyway back to normality, I'll be in your neck of the woods tomorrow for a nice break away. Upvote 0
nibbo said: Activity_PermissionResult works and B4XPage_PermissionResult does not. Click to expand... Hello @nibbo, That's an incorrect statement that can easy put other developers off from from using B4XPages if they read it. You obviously did something incorrectly, nevertheless as long as you have got your project working that's all that really matters at the end of the day. Anyway back to normality, I'll be in your neck of the woods tomorrow for a nice break away.