//1.实例化对话框
wareOrderDialog = new Dialog(ShopCarActivity.this, R.style.dialog);LayoutInflater inflater = LayoutInflater.from(ShopCarActivity.this);
View view = inflater.inflate(R.layout.view_ware_order_dialog, null);
//2.获取对话框中的控件
Button confirmBtn = (Button) view.findViewById(R.id.shopcar_dialog_confirm_btn);Button cancelBtn = (Button) view.findViewById(R.id.shopcar_dialog_cancel_btn);
ImageView shopcarDialogClose = (ImageView) view.findViewById(R.id.shopcar_dialog_close);
shopcar_dialog_beizhu = (EditText) view.findViewById(R.id.shopcar_dialog_beizhu);
shopcar_dialog_beizhu.clearFocus();//解决进入activity自动弹键盘问题
//3.弹出层绑定对话框的布局
wareOrderDialog.setContentView(view);
wareOrderDialog.setCancelable(false);
wareOrderDialog.show();
//4.设置对话框中的点击事件
confirmBtn.setOnClickListener(confirm_click);cancelBtn.setOnClickListener(cancel_click);
shopcarDialogClose.setOnClickListener(cancel_click);