本文整理汇总了Java中permissions.dispatcher.OnNeverAskAgain类的典型用法代码示例。如果您正苦于以下问题:Java OnNeverAskAgain类的具体用法?Java OnNeverAskAgain怎么用?Java OnNeverAskAgain使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OnNeverAskAgain类属于permissions.dispatcher包,在下文中一共展示了OnNeverAskAgain类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onLoggerChangeNeverAskAgain
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.WRITE_EXTERNAL_STORAGE)
void onLoggerChangeNeverAskAgain() {
fileLoggingLevelPreference.setValue(getString(R.string.preferences_file_logging_level_entries_value_disabled));
new AlertDialog.Builder(getActivity())
.setTitle(R.string.permission_denied)
.setMessage(R.string.permission_logging_never_ask_again_message)
.setCancelable(true)
.setPositiveButton(R.string.dialog_permission_settings, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
PermissionUtils.openAppSettings(getActivity());
}
})
.setNegativeButton(R.string.dialog_cancel, null)
.show();
}
示例2: onNeverAskAgain
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.CAMERA)
void onNeverAskAgain() {
new AlertDialog.Builder(this)
.setPositiveButton(R.string.permission_go_settings, new DialogInterface.OnClickListener() {
@Override
public void onClick(@NonNull DialogInterface dialog, int which) {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setData(Uri.parse("package:" + QRCodeScanActivity.this.getPackageName()));
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY
| Intent.FLAG_ACTIVITY_SINGLE_TOP
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
startActivity(intent);
}
})
.setCancelable(false)
.setTitle(R.string.permission_dialog_title)
.setMessage(R.string.permission_request_camera_denied)
.show();
}
示例3: onNeverAskAgain
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain({Manifest.permission.READ_PHONE_STATE, Manifest.permission.WRITE_EXTERNAL_STORAGE})
void onNeverAskAgain() {
new AlertDialog.Builder(this)
.setPositiveButton(R.string.permission_go_settings, new DialogInterface.OnClickListener() {
@Override
public void onClick(@NonNull DialogInterface dialog, int which) {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setData(Uri.parse("package:" + MainActivity.this.getPackageName()));
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY
| Intent.FLAG_ACTIVITY_SINGLE_TOP
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
startActivity(intent);
}
})
.setCancelable(false)
.setTitle(R.string.permission_dialog_title)
.setMessage(R.string.permission_request_necessary_denied)
.show();
}
示例4: onNeverAskAgain
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.WRITE_EXTERNAL_STORAGE)
void onNeverAskAgain() {
new AlertDialog.Builder(this)
.setPositiveButton(R.string.permission_go_settings, new DialogInterface.OnClickListener() {
@Override
public void onClick(@NonNull DialogInterface dialog, int which) {
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setData(Uri.parse("package:" + ShareActivity.this.getPackageName()));
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY
| Intent.FLAG_ACTIVITY_SINGLE_TOP
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
startActivity(intent);
}
})
.setCancelable(false)
.setTitle(R.string.permission_dialog_title)
.setMessage(R.string.permission_request_storage_denied)
.show();
}
示例5: showCameraPermissionDeniedForever
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain({Manifest.permission.CAMERA})
void showCameraPermissionDeniedForever() {
new AlertDialog.Builder(this)
.setTitle(R.string.permission_dialog_title)
.setMessage(R.string.permission_dialog_message)
.setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.cancel, null)
.show();
}
示例6: showLocationPermissionDeniedForever
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain({Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION})
void showLocationPermissionDeniedForever() {
if (isLocationPermissionDeniedForeverShown) {
return;
}
isLocationPermissionDeniedForeverShown = true;
new AlertDialog.Builder(this)
.setTitle(R.string.permission_dialog_title)
.setMessage(R.string.location_permission_not_granted_message)
.setPositiveButton(R.string.ok, null)
.show();
}
示例7: onClick
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.CALL_PHONE)
//用户选择不再询问后的提示
void showNotAsk() {
new AlertDialog.Builder(this)
.setMessage("该功能需要访问电话的权限,不开启将无法正常工作!")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}).show();
}
示例8: onPermissionNeverAskAgain
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
/**
* 当完全拒绝了权限打开之后调用
*/
@OnNeverAskAgain({Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.BLUETOOTH,
Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE})
void onPermissionNeverAskAgain() {
MyAlertDialog.showOpenSettingDialog(this, R.string.open_setting_permission);
}
示例9: onClick
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.CAMERA)
//用户选择不再询问后的提示
void showNotAsk()
{
new AlertDialog.Builder(context).setMessage("该功能需要摄像头权限,不开启将无法正常添加设备,只能手动在设置里面赋予权限")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}).show();
}
示例10: showNotAsk
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.WRITE_EXTERNAL_STORAGE)
//用户选择不再询问后的提示
void showNotAsk()
{
new AlertDialog.Builder(this).setMessage("该功能需要读写文件权限,不开启将无法下载新版apk,需要手动去设置里面赋予权限")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}).show();
mView.startAnim();
}
示例11: onClick
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain({
Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_PHONE_STATE,
Manifest.permission.RECORD_AUDIO
}) void showNeverAskForWriteExteralStorage() {
new AlertDialog.Builder(getActivity()).setPositiveButton("好的",
new DialogInterface.OnClickListener() {
@Override public void onClick(DialogInterface dialog, int which) {
startInstalledAppDetailsActivity(getActivity());
}
})
.setNegativeButton("取消", null)
.setCancelable(false)
.setMessage("您已经禁止了存储空间/电话/麦克风权限中的一项或全部,是否现在去开启")
.show();
}
示例12: showNeverAskForLocation
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain({Manifest.permission.WRITE_EXTERNAL_STORAGE})
void showNeverAskForLocation() {
MyToast.showToast("文件读写权限已被拒绝");
new AlertDialog.Builder(mContext).setTitle("提示")
.setMessage("下载文件需要文件读写权限。\n\n请点击\"设置\"-\"权限管理\"-打开所需权限。")
.setNegativeButton("取消", null)
.setPositiveButton("设置", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
startAppSettings();
}
})
.show();
}
示例13: OnCameraNeverAskAgain
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.CAMERA)
void OnCameraNeverAskAgain() {
canNeedsPermission = false;
mSnackbar = Snackbar.make(findViewById(android.R.id.content), R.string.permission_camera_never_ask_again, Snackbar.LENGTH_INDEFINITE).setAction(R.string.setting, new View.OnClickListener() {
@Override
public void onClick(View v) {
UIHelper.showAppDetailSetting(HeartRateActivity.this);
}
});
mSnackbar.show();
}
示例14: showNeverAskForExternalStorage
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.WRITE_EXTERNAL_STORAGE)
void showNeverAskForExternalStorage() {
if (isAdded()) {
Utils.showPopup(IMAGE_POPUP_ID_IGNORE, getActivity(), this, getString(R.string.permission_externalstorage_denied_title), getString(R.string.permission_externalstorage_neverask), R.drawable.thumbs_down_circle, null);
}
}
示例15: showNeverAskForLocation
import permissions.dispatcher.OnNeverAskAgain; //导入依赖的package包/类
@OnNeverAskAgain(Manifest.permission.ACCESS_FINE_LOCATION)
void showNeverAskForLocation() {
if (isAdded()) {
Utils.showPopup(IMAGE_POPUP_ID_IGNORE, getActivity(), this, getString(R.string.permission_location_denied_title), getString(R.string.permission_location_neverask), R.drawable.thumbs_down_circle, null);
}
}