1Dialog dialog = new Dialog(this);
2dialog.setContentView(R.layout.your_dialog_file);
3
4Button yourButton = dialog.findViewById(R.id.yourButton);
5final EditText text = dialog.findViewById(R.id.yourTextEdit);
6yourButton.setOnClickListener( {
7
8public void onClick(View view) {
9 if ( ! (text.getText().toString.equals(""))) {
10 //go on here and dismiss dialog
11 }
12
13});