📜  从适配器创建警报对话框 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:33.028000             🧑  作者: Mango

代码示例1
AlertDialog.Builder alertbox = new AlertDialog.Builder(v.getRootView().getContext());
    alertbox.setMessage("No Internet Connection");
    alertbox.setTitle("Warning");
    alertbox.setIcon(R.drawable.trn_03);

    alertbox.setNeutralButton("OK",
            new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface arg0,
                        int arg1) {

                }
            });
  alertbox.show();