0
我正尝试使用项目选项创建AlertDialog。我使用下面的代码在Android中的AlertDialog中显示项目时出现异常
final CharSequence[] items={"One","two","three"};
alertDialog = new AlertDialog.Builder(this).create();
alertDialog.setTitle("Choose COlor");
alertDialog.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// The 'which' argument contains the index position
// of the selected item
}
});
但我一直得到错误的编译
的方法setItems(CharSequence的[],新 DialogInterface.OnClickListener(){})是不确定的键入 AlertDialog
我很困惑,因为我看到使用该代码的所有例子,那么为什么这个错误?
谢谢..你救了我的日子:-) – user669231 2013-02-23 04:11:40