I\'m trying to make my app ready for Android 6 and now I\'m stuck to the point where you need to request and check permissions.
I tried the following from the docs:
As silly as it maybe, it could be in the wrong place. I had the same problem. The bolded part is where I had originally put the code. The italic part is where it should have gone
locationListener = new LocationListener() {
@Override
public void onLocationChanged(Location location) {
Log.i("-----------", location.toString());
}
**if (ContextCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) !=
PackageManager.PERMISSION_GRANTED) {'some code'}**
}; 'End of LocationListener method
*if (ContextCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION) !=
PackageManager.PERMISSION_GRANTED) { 'some code'}*