How to disable / enable dialog negative positive buttons?

前端 未结 7 1282
太阳男子
太阳男子 2020-11-28 23:30

Please look at the custom dialog below. I have an edittext field on the dialog and if the text field is empty I would like to disable the positiveButton. I can

7条回答
  •  臣服心动
    2020-11-28 23:53

    if (editTextEmailAddress.getText().toString().length() == 0) {
        btnCancelCross.setEnabled(false);
    } else {
        btnCancelCross.setEnabled(true);
    }
    

    That might help you thanks.

提交回复
热议问题