Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.your_dialog_file);
Button yourButton = dialog.findViewById(R.id.yourButton);
final EditText text = dialog.findViewById(R.id.yourTextEdit);
yourButton.setOnClickListener( {
public void onClick(View view) {
if ( ! (text.getText().toString.equals(""))) {
//go on here and dismiss dialog
}
});
标签:findViewById,Dialog,自定义,对话框,text,yourButton,编辑,dialog,id
From: https://blog.51cto.com/u_16166892/6524007