androidx.appcompat.app.AlertDialog.setCanceledOnTouchOutside()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中androidx.appcompat.app.AlertDialog.setCanceledOnTouchOutside()方法的一些代码示例,展示了AlertDialog.setCanceledOnTouchOutside()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AlertDialog.setCanceledOnTouchOutside()方法的具体详情如下:
包路径:androidx.appcompat.app.AlertDialog
类名称:AlertDialog
方法名:setCanceledOnTouchOutside

AlertDialog.setCanceledOnTouchOutside介绍

暂无

代码示例

代码示例来源:origin: proninyaroslav/libretorrent

@Override
  public void onShow(AlertDialog dialog)
  {
    dialog.setCanceledOnTouchOutside(false);
  }
}

代码示例来源:origin: AlexMofer/ProjectX

builder.setCancelable(false);
mDLoading = builder.create();
mDLoading.setCanceledOnTouchOutside(false);

代码示例来源:origin: 8enet/AppOpsX

.create();
alertDialog.setCanceledOnTouchOutside(false);
alertDialog.show();
Window window = alertDialog.getWindow();

代码示例来源:origin: MCMrARM/revolution-irc

public AlertDialog createDownloadApprovalDialog(Context context,
                        ActivityDialogHandler handler) {
  String title;
  if (getFileSize() > 0)
    title = context.getString(R.string.dcc_approve_download_title_with_size,
        getUnescapedFileName(), FormatUtils.formatByteSize(getFileSize()));
  else
    title = context.getString(R.string.dcc_approve_download_title,
        getUnescapedFileName());
  AlertDialog ret = new AlertDialog.Builder(context)
      .setTitle(title)
      .setMessage(context.getString(R.string.dcc_approve_download_body,
          mSender.toString(), getServerName()))
      .setPositiveButton(R.string.action_accept,
          (DialogInterface dialog, int which) -> {
            if (needsAskSystemDownloadsPermission())
              handler.askSystemDownloadsPermission(() -> approve());
            else
              approve();
          })
      .setNegativeButton(R.string.action_reject,
          (DialogInterface dialog, int which) -> reject())
      .setOnCancelListener((DialogInterface dialog) -> reject())
      .create();
  ret.setCanceledOnTouchOutside(false);
  return ret;
}

相关文章