new AlertDialog.Builder(this).setTitle("R.String.xxx").setMessage( "这是一个Dialog" )                     .setPositiveButton( "确定", new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog, int whichButton) {                                setResult( RESULT_OK); // 确定按钮事件                                                           }                     }).setNegativeButton( "取消", new DialogInterface.OnClickListener() {                            public void onClick(DialogInterface dialog, int whichButton) {                                 // 取消按钮事件                                                          }                     }).show();

更多相关文章

  1. android两次点击返回键退出和按钮退出对话框
  2. Android双击两次返回按钮退出程序
  3. android 确认对话框实例
  4. android 在标题栏加上按钮
  5. 报错android.view.WindowLeaked解决办法
  6. android 按钮按下时改变字体颜色
  7. Android(安卓)常用的ui(单选框 多选框 下拉列表框 拖动条)
  8. android与原生的JS交互
  9. Android(安卓)NavigationBar 代码分析记录(一)

随机推荐

  1. 在native c++里打log
  2. 使用TextView实现跑马灯Marquee
  3. Android(安卓)自定义View onDraw方法详解
  4. Android 剪贴板详解
  5. Android开发 设置控件边角半圆
  6. 简单研究Android View绘制一 测量过程
  7. android:imeOptions属性
  8. Android 编译时注解
  9. Android+Eclipse环境
  10. Android摄像头--通过Intent启动