No curso o professor pediu para fazermos a checagem de permissao para location, porem nao estou conseguindo. Fiz o seguinte na classe Localizador.java:
@Override
public void onConnected(@Nullable Bundle bundle) {
LocationRequest request = new LocationRequest();
request.setSmallestDisplacement(50);
request.setInterval(1000);
request.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
if (ActivityCompat.checkSelfPermission(context,
Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
ActivityCompat.checkSelfPermission(context,
Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions((ListaAlunosActivity) context,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_COARSE_LOCATION}, 321);
} else {
LocationServices.FusedLocationApi.requestLocationUpdates(client, request, this);
}
}
Meu aplicativo nao esta crashando, porem nao carrega o mapa.... Socorro!!!