我想设置它,当我选中复选框然后显示AlertDialog
. 但是发生了一个问题.. Eclipse 总是在我的AlertDialog
.
new AlertDialog.Builder(setting.this)
代码:
private CheckBox.OnCheckedChangeListener chkPasswordListener = new CheckBox.OnCheckedChangeListener(){
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// TODO Auto-generated method stub
if (chkSetPassword.isChecked()){
new AlertDialog.Builder(setting.this) //AlertDialog show red line.
.setMessage("Message,確定要結束?")
.setPositiveButton("確定", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialoginterface, int i)
// public void onClick(DialogInterface dialog, int i)
// TODO Auto-generated method stub
{
finish();
}
})
.setNegativeButton("取消", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialoginterface, int i)
{
// public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
})
.show();
}
}
我丢了什么东西吗?请帮我..