AlertDialog使用
2015-11-23 16:05
246 查看
AlertDialog使用
new AlertDialog.Builder(MainActivity.this) .setTitle("退出") .setMessage("你确定退出吗") .setCancelable(false) .setNegativeButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Toast.makeText(getApplicationContext(), "程序已结束", Toast.LENGTH_SHORT).show(); MainActivity.this.finish(); } }) .setPositiveButton("取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } })
.setCancleble(false)//设置返回键对其无效,不退出对话框,默认为ture
.setNegativeButton(“确定”, new DialogInterface.OnClickListener() {}//设置对话框确定按钮及相事件
相关文章推荐
- tableView的属性设置解析
- java日期格式大全 format SimpleDateFormat
- ServletRequest,HttpServletRequest ServletResponse,ServletResponse的区别
- 被忽略的技能
- 手游性能之渲染分析
- JAVA调用HTTPS双向认证API
- c:out escapeXml
- 第12周项目2-操作用邻接表存储的图
- 做一个Active To
- 本人对Oracle Inventory模块的一些了解
- linux shell编程
- Web Service入门教程
- 编译spark输出的信息
- 学习日记--网络通信框架--Volley应用
- Cookie工具类
- 声波通信开源项SinVoice介绍三
- 委托-异步调用-泛型委托-匿名方法-Lambda表达式-事件
- 问题:Oracle to_date;结果:oracle常用的时间格式转换
- C#反射取得方法、属性、变量
- proxool+tomcat配置