Skip to content

Instantly share code, notes, and snippets.

😈
Working @ Office

Mian Sarim Hameed MianSarimHameed

View GitHub Profile
View RuntimePermissionsHelper.java
private void getPermission() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (ContextCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
// Permission is not granted
if (ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.ACCESS_FINE_LOCATION)) {
You can’t perform that action at this time.