My app is using target-release version 22. I've mentioned FINE_LOCATION
permission in manifest
file.
When I'm running my app on android 6.0.1, it's working fine for my map-view where I'm showing current location.
But problem I'm getting when user "Deny" permission from app setting then app start crashing due to Permission-exception.
When I'm using below code
if ((ContextCompat.checkSelfPermission(activity, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED))
ActivityCompat.requestPermissions(activity, new String[] { Manifest.permission.ACCESS_FINE_LOCATION }, REQUEST_LOCATION_PERMISSION);
}
But this code always returning PackageManager.PERMISSION_GRANTED
.
Can someone help to resolve this issue?
I've already gone through these links - Understanding the Android 6 permission method Request Permission at Runtime for Android Marshmallow 6.0