AlertDialog 类型不兼容错误

AlertDialog Incompatible types error

我一直在尝试编译这个简单的警告对话框,以便在用户单击提交按钮时显示。编译代码时弹出错误信息:

Error:(33, 74) error: incompatible types: <anonymous OnClickListener> cannot be converted to Context

这个class叫做Login_Activity,扩展了BaseActivity,扩展了Activity。

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);
    mUserNameEt = (EditText) findViewById(R.id.login_username_et);
    mPasswordEt = (EditText) findViewById(R.id.login_password_et);
    mSubmitBtn = (Button) findViewById(R.id.login_submit_btn);

    mSubmitBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            AlertDialog.Builder messageBox = new AlertDialog.Builder(this);
            messageBox.setTitle("Atlas Box");
            messageBox.setMessage("Dictionary.");
        }
    });
}

改变

AlertDialog.Builder messageBox = new AlertDialog.Builder(this);

AlertDialog.Builder messageBox = new AlertDialog.Builder(youractivityname.this);