本文整理汇总了Java中com.karumi.dexter.Dexter.continuePendingRequestsIfPossible方法的典型用法代码示例。如果您正苦于以下问题:Java Dexter.continuePendingRequestsIfPossible方法的具体用法?Java Dexter.continuePendingRequestsIfPossible怎么用?Java Dexter.continuePendingRequestsIfPossible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.karumi.dexter.Dexter
的用法示例。
在下文中一共展示了Dexter.continuePendingRequestsIfPossible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureDexterListeners
import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
private void configureDexterListeners() {
permissionListener = new MultiplePermissionsListener() {
@Override
public void onPermissionsChecked(MultiplePermissionsReport report) {
Timber.d("Accepted: %s", report.getGrantedPermissionResponses());
Timber.d("Denied: %s", report.getDeniedPermissionResponses());
if (report.areAllPermissionsGranted()) {
Timber.d("All granted, requesting");
requestPicture();
}
}
@Override
public void onPermissionRationaleShouldBeShown(List<PermissionRequest> permissions, PermissionToken token) {
Timber.d("should show rationale");
token.continuePermissionRequest();
}
};
anyPermissionDeniedListener = DialogOnAnyDeniedMultiplePermissionsListener.Builder
.withContext(this)
.withTitle("Camera & file permissions")
.withMessage("Camera & file permissions are needed for saving pictures")
.withButtonText("Ok")
.build();
Dexter.continuePendingRequestsIfPossible(anyPermissionDeniedListener);
}
示例2: onCreate
import com.karumi.dexter.Dexter; //导入方法依赖的package包/类
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sample_activity);
ButterKnife.bind(this);
createPermissionListeners();
/*
* If during the rotate screen process the activity has been restarted you can call this method
* to start with the check permission process without keep in an Android Bundle the state of
* the request permission process.
*/
Dexter.continuePendingRequestsIfPossible(allPermissionsListener);
}