[Java] Android一个简单的警告框,带标题、图标、按钮 →→→→→进入此内容的聊天室

来自 , 2020-12-29, 写在 Java, 查看 135 次.
URL http://www.code666.cn/view/4ba92990
  1. AlertDialog alertDialog = new AlertDialog.Builder(this).create();
  2. alertDialog.setTitle("Title");
  3. alertDialog.setMessage("Message");
  4. alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
  5.    public void onClick(DialogInterface dialog, int which) {
  6.       // TODO Add your code for the button here.
  7.    }
  8. });
  9. // Set the Icon for the Dialog
  10. alertDialog.setIcon(R.drawable.icon);
  11. alertDialog.show();
  12. //java/5504

回复 "Android一个简单的警告框,带标题、图标、按钮"

这儿你可以回复上面这条便签

captcha