Validation on EditText in alertDialog

后端 未结 3 1775
广开言路
广开言路 2021-01-18 18:38

I am trying to add empty field validations on EditText on AlertDialog. But even after field is empty error message is not getting displayed, instea

3条回答
  •  走了就别回头了
    2021-01-18 19:22

    Try like this:

    if (TextUtils.isEmpty(edEvent)) {
        editEvent.setError("Please Enter Event Name.");
        editEvent.requestFocus();
        return;
    }
    

提交回复
热议问题