Enable and disable Button according to the text in EditText in Android

后端 未结 3 1072
盖世英雄少女心
盖世英雄少女心 2020-12-17 14:59

I want to disable by Button if the words in the EditText is less than 3 words, and if the words in the EditText are more than 3 words then I want to enable it so that it can

3条回答
  •  孤街浪徒
    2020-12-17 15:24

    You can do what @Udaykiran says but use arg0.length() instead.

    The Editable also contains the length of the content of the TextEditor that was changed

提交回复
热议问题