Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Request access to location while app is in background,
<manifest>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
</manifest>
//Request for the permission like any other permission request:
ActivityCompat.requestPermissions(this,
arrayOf(Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_BACKGROUND_LOCATION),
your-permission-request-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment