这是我正在使用的警报对话框的代码:
new AlertDialog.Builder(AlertDemo.this)
.setTitle("This is Alert Demo")
.setMessage("Here is an Alert Message!")
.setNeutralButton("Close", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dlg, int sumthin)
{
// do nothing – it will close on its own
}
})
.show();
当我写this
而不是AlertDemo.this
显示错误时The constructor AlertDialog.Builder(new View.OnClickListener(){}) is undefined
..这是什么意思?this
和有什么区别AlertDemo.this
?