如何解决AlertDialog.Builder没有dismiss方法
1个回答
展开全部
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();
}
});
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();
}
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询