Android一个简单的警告框,带标题、图标、按钮的代码

it2025-12-22  15

工作之余,将内容过程比较常用的内容做个珍藏,下面内容是关于Android一个简单的警告框,带标题、图标、按钮的内容,应该是对大伙有些用。 AlertDialog alertDialog = new AlertDialog.Builder(this).create();alertDialog.setTitle("Title");alertDialog.setMessage("Message");alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { }});alertDialog.setIcon(R.drawable.icon);alertDialog.show();

 

转载于:https://www.cnblogs.com/codeoldman/p/10295034.html

最新回复(0)