android 提示对话框显示 AlertDialog
2013-05-15 16:56
393 查看
做项目中,经常可能会用到对话框,提示用户是否是确认操作,AlertDialog就是常用的一种提示方式:
先看效果图:
实现:
这是这种对话框的使用方法,大家可以参考。
先看效果图:
实现:
AlertDialog.Builder delContactDialog = new Builder(getApplicationContext()); delContactDialog.setIcon(R.drawable.ic_launcher).setTitle(R.string.dialog_warning) .setMessage(R.string.dialog_warning_msg); delContactDialog.setPositiveButton(R.string.dialog_ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int whichbtn) { //to do } }); delContactDialog.setNegativeButton(R.string.dialog_cancel, new DialogInterface.OnClickListener(){ @Override public void onClick(DialogInterface dialog, int whichbtn) { dialog.dismiss(); } });
这是这种对话框的使用方法,大家可以参考。
相关文章推荐
- Android AlertDialog对话框的使用及实例(显示提示消息的对话框)
- ANDROID 系统提示对话框(ALERTDIALOG)的使用
- 菜鸟Android学习之路28——AlertDialog(4)显示带多个选列表项的对话框
- Android学习总结——系统提示对话框(AlertDialog)
- Android 系统提示对话框(AlertDialog)的使用
- android 系统提示对话框(AlertDialog)的使用
- Android中的弹出提示框 [此博文包含图片] (2014-01-21 16:42:31) 转载 ▼ 标签: android alertdialog 提示框 对话框
- android 系统提示对话框(AlertDialog)的使用
- 【Android开发】消息提示框与对话框-使用Notification在状态栏上显示通知
- android 系统提示对话框(AlertDialog)的使用
- 【Android开发】消息提示框与对话框-使用AlertDialog创建对话框
- 【Android开发】消息提示框与对话框-使用Toast显示消息提示框
- 使用AlertDialog创建简单的对话框1-显示提示消息的对话框
- android 系统提示对话框(AlertDialog)的使用
- 使Android应用的AlertDialog对话框中的按钮显示为ImageButton图标,并设置相应
- 显示提示消息的对话框
- android 用AlertDialog显示一个登陆界面的弹框
- Android 对话框AlertDialog,PopupWindow使用大全
- android 显示多选列表对话框setMultiChoiceItems