PermissionsUtil.requestPermission(getApplication(), new PermissionListener() { @Override public void permissionGranted(@NonNull String[] permissions) { Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI); startActivityForResult(intent, 0); } @Override public void permissionDenied(@NonNull String[] permissions) { Toast.makeText(AddAddressActivity.this, "用户拒绝了访问联系人", Toast.LENGTH_LONG).show(); } }, Manifest.permission.READ_CONTACTS);
//动态权限库 compile 'com.github.dfqin:grantor:2.5'