📜  数据验证对话框 android - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:36.383000             🧑  作者: Mango

代码示例1
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
   }

});