本文整理了Java中androidx.appcompat.app.AlertDialog.setCancelable()
方法的一些代码示例,展示了AlertDialog.setCancelable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AlertDialog.setCancelable()
方法的具体详情如下:
包路径:androidx.appcompat.app.AlertDialog
类名称:AlertDialog
方法名:setCancelable
暂无
代码示例来源:origin: martykan/webTube
private void show_noVideo_dialog() {
AlertDialog dialog = new AlertDialog.Builder(context/**/).create();
dialog.setTitle(context.getString(R.string.error_no_video));
dialog.setMessage(context.getString(R.string.error_select_video_and_retry));
dialog.setCancelable(true);
dialog.setButton(DialogInterface.BUTTON_POSITIVE, context.getString(android.R.string.ok).toUpperCase(),
(dialog1, buttonId) -> dialog1.dismiss());
dialog.show();
}
代码示例来源:origin: martykan/webTube
public void homepageTutorial() {
if (!sp.getBoolean("homepageLearned", false)) {
AlertDialog dialog = new AlertDialog.Builder(context).create();
dialog.setTitle(context.getString(R.string.home));
dialog.setMessage(context.getString(R.string.homePageHelp));
dialog.setCancelable(false);
dialog.setButton(DialogInterface.BUTTON_POSITIVE, "OK",
(dialog1, buttonId) -> {
dialog1.dismiss();
SharedPreferences.Editor editor = sp.edit();
editor.putBoolean("homepageLearned", true);
editor.apply();
});
dialog.show();
}
}
代码示例来源:origin: offensive-security/nethunter-app
private void showLicense() {
// @binkybear here goes the changelog etc... \n\n%s
String readmeData = String.format("%s\n\n%s",
getResources().getString(R.string.licenseInfo),
getResources().getString(R.string.nhwarning));
AlertDialog.Builder adb = new AlertDialog.Builder(this);
adb.setTitle("README INFO")
.setMessage(readmeData)
.setNegativeButton("Close", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
}); //nhwarning
AlertDialog ad = adb.create();
ad.setCancelable(false);
ad.getWindow().getAttributes().windowAnimations = R.style.DialogStyle;
ad.show();
}
代码示例来源:origin: martykan/webTube
alert.setTitle(context.getString(R.string.enableTor) + "?");
alert.setMessage(context.getString(R.string.torWarning));
alert.setCancelable(false);
alert.setButton(DialogInterface.BUTTON_POSITIVE, context.getString(R.string.enable),
(dialog, buttonId) -> {
代码示例来源:origin: offensive-security/nethunter-app
adi.setCancelable(false);
adi.show();
代码示例来源:origin: offensive-security/nethunter-app
ad.setCancelable(true);
ad.show();
代码示例来源:origin: offensive-security/nethunter-app
ad.setCancelable(false);
ad.show();
} else {
代码示例来源:origin: offensive-security/nethunter-app
ad.setCancelable(false);
ad.show();
代码示例来源:origin: offensive-security/nethunter-app
private void downloadOrSdcard() {
AlertDialog.Builder adb = new AlertDialog.Builder(getActivity());
adb.setTitle("Select Chroot install mode:")
.setMessage("Download is the prefered mode. Get the latest chroot from the offsec servers.\n\n Also you can place a custom\nkalifs-[minimal|full].tar.xz in /sdcard\nand skip the download.")
.setNeutralButton("Use SdCard", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
fullOrMinimal(false);
}
})
.setPositiveButton("Download Latest", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
fullOrMinimal(true);
}
});
AlertDialog ad = adb.create();
ad.setCancelable(false);
ad.show();
}
代码示例来源:origin: morogoku/MTweaks-KernelAdiutorMOD
alertDialog.setCancelable(isDialogCancelable);
alertDialog.show();
break;
case DIALOG:
alertDialog = UtilsDisplay.showUpdateNotAvailableDialog(context, titleNoUpdate, getDescriptionNoUpdate(context));
alertDialog.setCancelable(isDialogCancelable);
alertDialog.show();
break;
代码示例来源:origin: offensive-security/nethunter-app
ad.setCancelable(false);
ad.show();
代码示例来源:origin: offensive-security/nethunter-app
ad.setCancelable(false);
ad.show();
内容来源于网络,如有侵权,请联系作者删除!