[小代码]简单的对话框设置标题、消息、图标和按钮
2013-05-13 12:03
411 查看
别忘了 import android.app.AlertDialog; import android.content.DialogInterface;
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) { // TODO Add your code for the button here. } }); // Set the Icon for the Dialog alertDialog.setIcon(R.drawable.icon); alertDialog.show();
相关文章推荐
- Qt窗口的一些简单设置-标题、图标、最大化最小化按钮、任务栏图标
- Qt窗口的一些简单设置-标题、图标、最大化最小化按钮、任务栏图标
- MFC 基于对话框的按钮图标设置
- 金蝶EAS,代码实现窗口最大化,按钮可用,图标设置
- Android 通过代码设置标题图标
- 使Android应用的AlertDialog对话框中的按钮显示为ImageButton图标,并设置相应
- js+html纯原生代码 简单的下载对话框 点击按钮自动读条
- 基于UDP的简单收发消息代码
- js代码,执行简单的按钮翻转
- 经由过程代码设置radiobutton不合方位图标的两种办法
- Swift 设置按钮圆角 代码&Xib
- JS点击某个图标或按钮弹出文件选择框的实现代码
- php简单设置与删除cookie代码
- (四十)android在代码中,如何设置自定义对话框在屏幕中的位置和大小
- iOS开发--底部按钮和应用图标显示未读消息
- 在模态对话框中设置左上角图标
- 我在BCB中实现消息处理的简单代码--XJQ2003
- 如何在属性对话框标题栏加图标和最小化按钮?
- 设置图标按钮
- 点击一个按钮实现在不同对话框之间的切换,帮忙看下这代码能不能这样写,为什么不对呀