一个例子中的一行代码: AlertDialog dlg = new AlertDialog.Builder(this); 输入后提示错误: Type mismatch: cannot convert from AlertDialog.Builder to AlertDialog 错在什么地方? 怎样写才能声明一个对话框对象?
解决方案 »
- 求教~~~新人理解 Handler 异步 时的问题?
- 求Android学习用的书籍,元芳,你怎么看?
- android 如何缩放组件
- AlertDialog.Builder.create().show()和AlertDialog.Builder.show()有什么区别?
- 获取音乐播放器当前歌曲播放位置的问题
- gridview item 设置为disenable
- R.string.notify_incorrect_phonebumber eclipse无法解析
- 关于蓝牙ble的readCharacteristic这个方法
- 在android64位平台预置32位apk库文件报错,手动安装又不会报错。有什么区别吗?
- Android Ethernet开发
- android + linux下的二个问题
- 不信难不倒你
AlertDialog dialog = new AlertDialog.Builder(this)
.setIcon(R.drawable.icon)
.setTitle("退出对话框")
.setMessage("您真的要退出吗")
.setNegativeButton("取消",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int which) {
}
})
.setPositiveButton("确定",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int whichButton) {
LocalInfoActivity.this.finish();
}
}).create();
dialog.show();
而不是AlertDialog返回的是什么估计LZ是C++ 出生?
adb.setTitle("提示");
adb.setMessage("kkkkkkkk");
adb.setIcon(R.drawable.icon);
adb.setNegativeButton("取消", null);
adb.create().show();楼主用这个!!!
AlertDialog dlg = new AlertDialog.Builder(this).create();应该就对了