Credits for the answer to @Stephen Ruda

I have run into the exact same problem. I agree that this is an issue for any developer who needs background location permission. I would like to add additional notes for other readers:

(1) On API 30+ you will first need basic location permissions before asking for background location permission - otherwise, it won't go to the permission screen at all.

(2) When you ask for background location permission and it sends them to the permission request screen, it will only 'lock' the user out if they ONLY hit the back button. If they tap any of the options and then back the request will work again.

Answer from Victor Laerte on Stack Overflow
🌐
Google Support
support.google.com › googleplay › android-developer › answer › 9799150
Understanding location in the background permissions - Play Console Help
If you don’t see the declaration prompt in Google Play Console, confirm that you’re using one of the sensitive location permissions according to the target SDK level of your app: If your app bundle or APK targets Android 10 or newer (SDK level 29 or higher) and contains ACCESS_BACKGROUND_LOCATION permission in the manifest, you’ll be directed to complete details on location usage.
🌐
Android Developers
developer.android.com › core areas › sensors and location › request location permissions
Request location permissions | Sensors and location | Android Developers
On Android 10 (API level 29) and higher, you must declare the ACCESS_BACKGROUND_LOCATION permission in your app's manifest in order to request background location access at runtime.
Discussions

Android 11 users can’t grant background location permission? - Stack Overflow
As of Android 11, apps targeting ... location permission to an app more than once. If not initially granted, it requires users to go to a settings page. How do we bring a user to the proper settings page? When a feature in your app requests background location on a device that runs Android 11 or higher, the system dialog doesn't include a button to enable background location access... More on stackoverflow.com
🌐 stackoverflow.com
kotlin - How to access background location permission on runtime in android 13? - Stack Overflow
How to access background location permission on runtime in android 13? Here is my code. Its not showing any popup for access permission from users. Im new to android. fun askForLocationPermission( More on stackoverflow.com
🌐 stackoverflow.com
How to request background locations with API 29 and above?
Yesterday I did a lot of tests to figure out how things worked regarding permissions and background location (full report here). It's clear that background permission is more difficult to get approved since API 29. How do we request permission for background locations in API 29 and above? I... More on b4x.com
🌐 b4x.com
0
0
March 3, 2021
Background location access confusion
I wrote a small blog about background location access. I think it'll help you. https://link.medium.com/jFlbILSq1cb More on reddit.com
🌐 r/androiddev
23
12
January 13, 2021
🌐
Android Developers
developer.android.com › core areas › sensors and location › access location in the background
Access location in the background | Sensors and location | Android Developers
February 26, 2026 - Use the following checklist to identify potential location access logic in the background: In your app's manifest, check for the ACCESS_COARSE_LOCATION permission and the ACCESS_FINE_LOCATION permission.
🌐
Android Developers
developer.android.com › core areas › sensors and location › request background location
Request background location | Sensors and location | Android Developers
The user-visible label of the settings option that grants background location (for example, Allow all the time in figure 7). You can call getBackgroundPermissionOptionLabel() to get this label.
🌐
Google
developers.google.com › google maps platform › android › navigation sdk for android › background location usage best practices
Background location usage best practices | Navigation SDK for Android | Google for Developers
April 13, 2026 - This page explains best practices for requesting and managing background location usage permissions. Starting with Android 14, apps must have the ACCESS_BACKGROUND_LOCATION permission in order to access the user's location.
🌐
Notificare
notificare.com › blog › 2024 › 01 › 26 › android-location-permission-guide
Android Location Permission Guide | Notificare
January 26, 2024 - --> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- Background location access. --> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> </manifest> Foreground location access can be either Approximate or Precise.
🌐
Medium
mohitsingh2002.medium.com › background-location-permission-in-android-11-and-above-1ab7399ec861
Background Location Permission in Android 11 and above | by Mohit Singh | Medium
June 23, 2021 - For using foreground and background location in lower versions of Android 11, we can take permission ACCESS_FINE_LOCATION, this permission will be considered for both foreground and background but with Android 11 and above you have to take one ...
Find elsewhere
Top answer
1 of 3
22

Credits for the answer to @Stephen Ruda

I have run into the exact same problem. I agree that this is an issue for any developer who needs background location permission. I would like to add additional notes for other readers:

(1) On API 30+ you will first need basic location permissions before asking for background location permission - otherwise, it won't go to the permission screen at all.

(2) When you ask for background location permission and it sends them to the permission request screen, it will only 'lock' the user out if they ONLY hit the back button. If they tap any of the options and then back the request will work again.

2 of 3
0

you cannot request foreground and background permission same time and cannot request background location permission without foreground permission granted. Therefore first you have to request foreground permission and then 'onRequestPermissionsResult' you can request background permission

First in onCreate

 if (ActivityCompat.checkSelfPermission(
            this,
            Manifest.permission.ACCESS_COARSE_LOCATION
    ) != PackageManager.PERMISSION_GRANTED || ActivityCompat.checkSelfPermission(
            this,
            Manifest.permission.ACCESS_FINE_LOCATION
    ) != PackageManager.PERMISSION_GRANTED
    ) {

        ActivityCompat.requestPermissions(
                this,
                new String[]{
                        Manifest.permission.ACCESS_COARSE_LOCATION,
                        Manifest.permission.ACCESS_FINE_LOCATION
                },
                1
        );


   @Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    super.onRequestPermissionsResult(requestCode, permissions, grantResults);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
        ) {
            if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_BACKGROUND_LOCATION) != PackageManager.PERMISSION_GRANTED
            ) {
                ActivityCompat.requestPermissions(
                        this,
                        new String[]{Manifest.permission.ACCESS_BACKGROUND_LOCATION},
                        1
                );
            }
        }
    }
}
🌐
Medium
medium.com › @ty2 › understanding-permissions-for-background-location-on-android-11-and-below-bc3ad9be320a
Understanding permissions for background location on Android 11 and below | by Abhi | Medium
August 27, 2024 - When requesting location permission on Android 11, it will show 3 options with an additional message. The message tells the user that if she wishes to allow the app access to location all the time, then enable it in settings.
🌐
Google
android-developers.googleblog.com › 2020 › 11 › tips-for-getting-your-app-approved-for-background-location-access.html
Android Developers Blog: Tips for getting your app approved for background location access
If your app uses background location data, you must submit a form for review and receive approval by January 18, 2021 so your apps can stay on Google Play. Existing apps first published before April 16, 2020 have until March 29, 2021 to comply.
🌐
Android Developers
developer.android.com › about › versions › 11 › privacy › location
Location updates in Android 11 | Android Developers
In order to enable background location access, users must set the Allow all the time option for your app's location permission on a settings page, as described in the guide on how to Request background location.
🌐
Ackee
ackee.agency › blog › how-to-fetch-location-in-background-on-android
How to Reliably Fetch Location in Background on Newest Andro
February 14, 2023 - This is a normal permission, so ... apps targeting API level 28+ ... ACCESS_BACKGROUND_LOCATION permission is now required when accessing location while the app is in the background....
🌐
Medium
medium.com › @adrian.kajda › new-guidelines-for-accessing-background-location-in-android-d2e07d45ae79
New guidelines for accessing background location in Android | by Adrian Kajda | Medium
January 21, 2021 - Verify if you really need background permission access. You can still use foreground service for location (if you are not starting it from the broadcast receiver or any other background process). In that case foreground service is becoming background service and you need this permission. Show proper dialog telling how you use location in your app. Do it always before asking for any location permission. Remember about using proper scope for asking for background location (especially for Android 11)
🌐
Stack Overflow
stackoverflow.com › questions › 77299714 › how-to-access-background-location-permission-on-runtime-in-android-13
kotlin - How to access background location permission on runtime in android 13? - Stack Overflow
import android.Manifest import android.app.Activity import androidx.activity.result.contract.ActivityResultContracts import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat fun askForLocationPermission( activity: Activity, permissionGranted: (() -> Unit), permissionDenied: (() -> Unit)? = null ) { val permissions = arrayOf( Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION ) val requestPermissionLauncher = activity.registerForActivityResult(ActivityResultContracts.RequestPermission()) { isGranted -> if (isGranted) { permissionGr
🌐
B4X
b4x.com › home › forums › b4a - android › android questions
How to request background locations with API 29 and above? | B4X Programming Forum
March 3, 2021 - Allows an app to access location in the background. If you're requesting this permission, you must also request either ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION. Requesting this permission by itself doesn't give you location access.
🌐
Android Open Source Project
source.android.com › docs › core › permissions › background-location-access
Background location access reminder | Android Open Source Project
April 10, 2026 - In Android 9 and lower, an app can track a device's location while running in the background without the user's knowledge. Users can suppress this behavior in Android 10 by selecting either the Allow only while using the App or Deny location access permission.
🌐
Google
android-developers.googleblog.com › 2020 › 02 › safer-location-access.html
Android Developers Blog: Safer and More Transparent Access to User Location
Now in Android 11, we’re giving users even more control with the ability to grant a temporary “one-time” permission to sensitive data like location. When users select this option, apps can only access the data until the user moves away from the app, and they must then request permission again for the next access. Please visit the Android 11 developer preview to learn more. Preventing unnecessary access to background location
🌐
Medium
medium.com › @mahbooberezaee68 › background-location-limits-over-different-android-versions-df67202250fd
Background Location Limits Over Different Android Versions | by Bahar | Medium
January 9, 2025 - Background Location Access Changes ... a button to directly enable it. Users must go to the system settings to grant “Allow all the time” permission for location access....
🌐
GitHub
github.com › Woosmap › geofencing-android-sdk › blob › master › doc › EnablingLocation.md
geofencing-android-sdk/doc/EnablingLocation.md at master · Woosmap/geofencing-android-sdk
When the user next opens your app ... on a device that runs Android 10 (API level 29), the system permissions dialog includes an option named Allow all the time....
Author   Woosmap
🌐
Pulsatehq
docs.pulsatehq.com › v2.8.2 › reference › android-permissions
Location Permission Implementation
// On Foreground Location Priming Screen if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) { int foregroundCheck = ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION); if (foregroundCheck != PackageManager.PERMISSION_GRANTED) { requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 1); } } After the user accepts foreground location we can ask for background location.