0
When I use this permission an error occurs in the WHOLE. What I do?
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return TODO;
}
This is the mistake:
Error:(40, 20) error: incompatible types: Unexpected Return value
Have to return something then. What would be ALL?
– Pablo Almeida
Bro, you know what this permit is for?
– Estevoliveira
this ALL it creates automatically
– Estevoliveira
Localization. But your doubt doesn’t seem to be about it. You don’t seem to understand what you’re doing. You copied and pasted?
– Pablo Almeida
I really don’t know. I am trying to make a project q returns the current latitude and longitude and when I use Locationmanager.requestLocationUpdate() it asks for this permission.
– Estevoliveira
Look here on the site about asking for permissions on Android 6. You have to understand what you’re doing before asking why the code doesn’t work.
– Pablo Almeida