Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Advanced Permission Handler

This library have an abstact Activty, advancedPermissionHandlerActivity is that handle all permission stuff, pice of cake. Main idea is from my dear friend Ali Nemati hayati.

Just inherit your desired Activity from PermissionHandlerActivity and simply call one of askForPermission() methods which one with auto-generate message ability for your given permissions (works for Farsi right now) and one with your custom message.

String[] permissions = new String[] {Manifest.permission.SEND_SMS, 
Manifest.permission.WRITE_EXTERNAL_STORAGE , Manifest.permission.READ_EXTERNAL_STORAGE , ...}

boolean stickyMode = true;

askForPermission(permissions , stickyMode, new PermissionCallBack() {
                    public void onPermissionsGranted() {  
                        Log.i("mahdi", "onPermissionsGranted: ");

                    public void onPermissionsDenied(String[] permissions) {
                        Log.i("mahdi", "onPermissionsDenied: ");

These are steps:

  1. First ask for all permissions.
  2. Then try to aks for ungranted-permissions with custom message again from user.
  3. Then try to open settings for permissions if user set 'Don't ask again'
  4. Finaly if user deny, onPermissionsDenied callback will triggers.

Sticky mode specifies that, if all these four steps happen in one session or not.

For using advancedPermissionHandler add this line to gradle:

compile '               

Mahdi Tajik

my weblog:


No releases published


No packages published