androidpermissionsruntime-permissions

How to detect "Allow only while using the app" permission when user give location permission


This is a basic question but I not find a solution for this scenario. I used "Dexter" library to ask for runtime permissions. I need to get background location permission so that I ask for permission , then I saw in Android Q there is an option "Allow only while using the app" , but while using dexter I'm unable to detect when user choose this option. Can anyone help me how I solve this condition?


Solution

  • Have you tried the one explained by the Dexter team? (Example on requesting ACCESS_BACKGROUND_LOCATION permission is there)

    Application stuck when requesting ACCESS_BACKGROUND_LOCATION

    And in Google's Official API, they mentioned the new addition to Background Location check: ACCESS_BACKGROUND_LOCATION

    Background location access checklist

    This API specifically added for just that: to check if user chooses to permit location while using the app (or means, app in foreground, not background) or not