如何解决AlertDialog.Builder没有dismiss方法
发布网友
发布时间:2022-09-18 02:45
我来回答
共1个回答
热心网友
时间:2023-10-19 19:44
dialog = new AlertDialog.Builder(this);
final View view = View.inflate(this,R.layout.dialog_register,null);
Button btn_dismiss = (Button) view.findViewById(R.id.btn_dismiss);
Button btn_code = (Button) view.findViewById(R.id.btn_code);
dialog.setView(view);
final AlertDialog dia = dialog.show();
btn_dismiss.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dia.dismiss();
}
});