I am having some trouble with asking for FINE_LOCATION in my app. I have tried to read a bit about ACCESS_FINE_LOCATION and i know i should ask for it together with ACCESS_COARSE_LOCATION for android 12, but it seems to only show me the "approximate location" everytime i ask. It doesnt even ask for FINE_LOCATION.
Here is my code
Manifest:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Code:
//asking for permission inside a method
requestMultiplePermissions.launch(arrayOf(ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION ))
// registering activity for result.
activity.registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { permissions ->
if(permissions.entries.all { it.value }){
checkPermissionsAndContinue()
}else{
val deniedPermission = permissions.entries.find { !it.value }
deniedPermission?.key?.let { showPermissionDeniedDialog(it) }
}
I have tried to run on android 31 emulator and my phone on android 12. Same result. Never get the fine location, just the coarse location. It seems to work fine for all other android versions, its just the android 12 fine location stuff thats stopping me.
Does someone have a idea where i could take a look to fix this? Thank you so much!