You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to differentiate between the permission that I am calling is first time or user have selected on the never asked again.
In sample you have mentioned this thing.
@OnClick(R.id.buttonLocation) public void clickButtLocation() { if (Nammu.checkPermission(Manifest.permission.ACCESS_FINE_LOCATION)) { boolean hasAccess = Tools.accessLocation(this); Toast.makeText(this, "Access granted fine= " + hasAccess, Toast.LENGTH_SHORT).show(); } else { if (Nammu.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION)) { //User already refused to give us this permission or removed it //Now he/she can mark "never ask again" (sic!) Snackbar.make(mLayout, "Here we explain user why we need to know his/her location.", Snackbar.LENGTH_INDEFINITE).setAction("OK", new View.OnClickListener() { @Override public void onClick(View view) { Nammu.askForPermission(MainActivity.this, Manifest.permission.ACCESS_FINE_LOCATION, permissionLocationCallback); } }).show(); } else { //First time asking for permission // or phone doesn't offer permission // or user marked "never ask again" Nammu.askForPermission(MainActivity.this, Manifest.permission.ACCESS_FINE_LOCATION, permissionLocationCallback); } } }
Here in comments you have mentioned
First time asking permission
or user marked "never ask again."
I want to know when user selected never asked again and proceed further
The text was updated successfully, but these errors were encountered:
How to differentiate between the permission that I am calling is first time or user have selected on the never asked again.
In sample you have mentioned this thing.
@OnClick(R.id.buttonLocation) public void clickButtLocation() { if (Nammu.checkPermission(Manifest.permission.ACCESS_FINE_LOCATION)) { boolean hasAccess = Tools.accessLocation(this); Toast.makeText(this, "Access granted fine= " + hasAccess, Toast.LENGTH_SHORT).show(); } else { if (Nammu.shouldShowRequestPermissionRationale(this, Manifest.permission.ACCESS_FINE_LOCATION)) { //User already refused to give us this permission or removed it //Now he/she can mark "never ask again" (sic!) Snackbar.make(mLayout, "Here we explain user why we need to know his/her location.", Snackbar.LENGTH_INDEFINITE).setAction("OK", new View.OnClickListener() { @Override public void onClick(View view) { Nammu.askForPermission(MainActivity.this, Manifest.permission.ACCESS_FINE_LOCATION, permissionLocationCallback); } }).show(); } else { //First time asking for permission // or phone doesn't offer permission // or user marked "never ask again" Nammu.askForPermission(MainActivity.this, Manifest.permission.ACCESS_FINE_LOCATION, permissionLocationCallback); } } }
Here in comments you have mentioned
First time asking permission
or user marked "never ask again."
I want to know when user selected never asked again and proceed further
The text was updated successfully, but these errors were encountered: