Open TWiStErRob opened 2 years ago
You can implement EasyPermissions.PermissionCallbacks
and then accept either location permission in onPermissionGranted()
callback.
@Override
public void onPermissionsGranted(int requestCode, @NonNull List<String> perms) {
if (perms.contains(Manifest.permission.ACCESS_COARSE_LOCATION) ||
perms.contains(Manifest.permission.ACCESS_FINE_LOCATION)) {
// App can access device's location
}
}
Basic Information
Device type: emulator OS version: 30 EasyPermissions version: 3.0.0
Describe the problem
I have an app that needs location, doesn't matter which permission. Since we have 2 of these, it's quite tricky, and didn't even start considering the background one.... The app works with coarse or fine, but has a better experience with fine.
If I pass this to
requestPermissions
with a rationaleI get 2 permission dialogs (fine/coarse selector, and upgrade from coarse to fine) and the rationale dialog, if the user selects the coarse location to begin with. I think this is because EasyPermissions thinks that not all permissions were granted. Is there a way to solve this? I guess I need
or
instead ofand
relationship between items in the list?