Last active
July 10, 2019 16:01
-
-
Save saurabharora90/a7f6606e5d2e5318115c2c7dd284a690 to your computer and use it in GitHub Desktop.
Request access to location while app is in background,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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