android之AlertDailog使用
来源:互联网 发布:xp无法映射网络驱动器 编辑:程序博客网 时间:2024/03/29 07:57
Builder builder=new AlertDialog.Builder(Main.this); 用AlertDailog内部类来创建dailog
builder.setTitle("测试对对话");
builder.setMessage("也会影响日常的工作学习。当你感觉你正在被一些问题所困扰时,不妨试着照下面的方法去做,也许对你会有所帮助。 1、转移你的注意力" +
" 当人的情绪处于低潮时,对任何事情都提不起兴趣。总是想着那些伤心的事情。所以,要想摆脱这种情绪,首先应该让自己不要总。当你感觉你正在被一些问题所困扰时," +
"不妨试着照下面的方法去做,也许对你会有所帮助。 1" +
"、转移你的注意力 当人的情绪处于低潮时,对任何事情都提不起兴趣。总是想着那些伤心的事情。所以,要想摆脱这种情绪,首先应该让自己不要总");
builder.setCancelable(false);
builder.setPositiveButton("是", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
builder.setNeutralButton("否", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
});
// builder.setItems(colors, new DialogInterface.OnClickListener()//设置没有有单选按钮对话框
// {
// public void onClick(DialogInterface dialog, int which) {
// Log.i("test", "which:"+which);
// switch(which)
// {
// case 0:
// liner.setBackgroundColor(Color.RED);
// break;
// case 1:
// liner.setBackgroundColor(Color.BLUE);
// break;
// case 2:
// liner.setBackgroundColor(Color.YELLOW);
// break;
// case 3:
// liner.setBackgroundColor(Color.GREEN);
// break;
//
// }
//
// }
//
// });
// builder.setSingleChoiceItems(colors, 1, new DialogInterface.OnClickListener() //设置有单选按钮对话框
// {
//
// public void onClick(DialogInterface dialog, int which) {
// // TODO Auto-generated method stub
// switch(which)
// {
// case 0:
// liner.setBackgroundColor(Color.RED);
// break;
// case 1:
// liner.setBackgroundColor(Color.BLUE);
// break;
// case 2:
// liner.setBackgroundColor(Color.YELLOW);
// break;
// case 3:
// liner.setBackgroundColor(Color.GREEN);
// break;
//
// }
// }
//
// });
builder.show();//显示对话框
- android之AlertDailog使用
- AlertDailog: android.view.WindowManager$BadTokenException: Unable to add window -- token null is no
- 安卓中Alertdailog中含有EditText不能输入解决办法
- Android之handler使用
- android之handler使用
- android之handler使用
- android之selector使用
- Android之资源使用
- android之webview使用
- android之PendingIntent使用
- android之webview使用
- android之service使用
- Android之TextView使用
- Android之JNI使用
- Android之AssetManager使用
- Android 之GridView使用
- Android之Vibrator使用。
- Android之AIDL使用
- 提取Launcher中的WorkSapce,可以左右滑动切换屏幕页面的类
- 让我弄了一晚上!Oracle遇到了这ora-01033问题
- flex AdvancedDataGrid 高级表格 介绍 教程
- linux上ln命令详细说明
- jxls导出excel,long 转换double,两个Integer数进行比较
- android之AlertDailog使用
- zlib使用
- 使用JavaScript实现判断密码强度
- linux 的 ls 命令的使用方法
- JS中的反射
- 走进AJAX
- LUA与python根本就不具有可比性
- Excel函数大全
- python学习笔记