             // if button is clicked, close the custom dialog             dialogButton.setOnClickListener(new OnClickListener() {                 @Override                 public void onClick(View v) {                     dialog.dismiss();                 }             });             