edit_PASSWORD.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
final Dialog dialog = new Dialog(context);
dialog.setContentView(R.layout.change_password);
dialog.setTitle("Title...");
EditText txtPassword = (EditText) dialog.findViewById(R.id.changepwd);
EditText txtVpassword = (EditText) dialog.findViewById(R.id.changevpwd);
Button btnOk = (Button) findViewById(R.id.btnch_ok);
Button btnCancle = (Button) findViewById(R.id.btnch_cancle);
btnCancle.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//dialog.dismiss();
}
});
dialog.show();
}
});
}
我正在尝试创建自定义警报对话框,但是当我单击 btnCancle 时,程序崩溃并出现错误:
错误:Android中的NullPointerException按钮单击
抱歉英语不好。