Call requires permissions that may be rejected by user

Which SDK do you use? If you use Marshmallow, then you need to check that the user has granted permission for every location call.

Take a look Here.

You should do something like this:

  if (ContextCompat.checkSelfPermission( this,android.Manifest.permission.ACCESS_COARSE_LOCATION ) != PackageManager.PERMISSION_GRANTED )
{
    ActivityCompat.requestPermissions(
        this,
        new String [] { android.Manifest.permission.ACCESS_COARSE_LOCATION },
        LocationService.MY_PERMISSION_ACCESS_COURSE_LOCATION
    );
}

request permission if you dont have it already.

check the link above for more info.

Leave a Comment