Android Question Display Location Permissions Settings Page

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hello

I need to show the Request location permissions | Android Developers settings page for this. Does anyone know the instent string for this. I amcurrently using this method:
B4X:
Sub check_permissions_location
   
    Dim rp As RuntimePermissions
    Dim p As Phone, locationResult As Boolean
   
     ' // location permissions
    rp.CheckAndRequest(rp.PERMISSION_ACCESS_COARSE_LOCATION)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
   
    rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
    Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
   
    If p.SdkVersion >= 29 Then
        rp.CheckAndRequest("android.permission.ACCESS_BACKGROUND_LOCATION")
        Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
        Log(Result)
        locationResult = Result
    End If

    ' // https://www.b4x.com/android/forum/threads/setting.72447/#content
    ' // https://developer.android.com/reference/android/provider/Settings#ACTION_LOCATION_SOURCE_SETTINGS
    If Not(locationResult) Then
        Dim StartIntent As Intent
        StartIntent.Initialize("android.settings.MANAGE_APPLICATIONS_SETTINGS", "")
        StartActivity(StartIntent)       
    End If
   

   
End Sub

I need to find the correct intent to show :



Regards

John.
 

JohnC

Expert
Licensed User
Longtime User
I haven't tried this myself, and I don't even know if it's possible, but if you know of an app that can properly display this screen, then you can try to capture the intent as it's invoked by that app.

First, connect your phone to your PC, run B4A, view the log tab, uncheck "filter", then click "connect", then right before you invoke this other app to display the screen, click the "clear" button, then have the app display the screen, wait a second or two, then disconnect your phone.

You should see a long list of events/messages that android processed.

You will have to do a little digging, but there is a chance that the log will have recorded the intent that invoked that screen.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Did you tried

 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
Yep, not exactly what I want. When the android.permission.ACCESS_BACKGROUND_LOCATION request is make the permissions screen is loaded. If the user selected deny, it can never be accessed by the app again. Our app does not function with location services. I need to show the screen in post #3 so the user can select the correct setting, in this case allow all the time.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
I did a quick search:


And these seem promising:


 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
I'm pretty sure there is none. Once a user makes a selection, this dialog will not be invoked from the app again unless the app is uninstalled / re-installed. Once a user has made a decision for a particular app, they have to manually change the permission in settings (and there is no direct intent for that, just like some other items in settings).
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
I thought as much, just hoping there was an intent to get me to the permissions of the app or as close to it as possible.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…