Untitled
unknown
plain_text
4 years ago
1.2 kB
9
Indexable
protected void acceptLocation() {
Hawk.put("show_dialog_permission", false);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (hasForegroundLocationPermission()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
if(hasBackgroundLocationPermission()){
startMonitoringLocation();
}else{
// TODO EXIBIR TELA INFORMANDO QUE PRECISAMOS
// DA LOCALIZACAO EM BACKGROUND POR X MOTIVO
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_BACKGROUND_LOCATION},
START_MONITORING_LOCATION);
}
}else{
startMonitoringLocation();
}
}else{
ActivityCompat.requestPermissions(this,
new String[]{
Manifest.permission.ACCESS_FINE_LOCATION}, START_MONITORING_LOCATION);
}
} else {
startMonitoringLocation();
}
}Editor is loading...