How can I get EditText change?

随声附和 提交于 2019-12-29 08:45:10

问题


I have a EditText and I want to inform each time text changes (with entering each character). What implementation should I use and what function should I override?


回答1:


Use the addTextChangedListener method on your EditText and make your class implement or define an inner class implementing the TextWatcher class:

https://developer.android.com/reference/android/widget/TextView.html#addTextChangedListener(android.text.TextWatcher)




回答2:


You can declare a boolean variable as false and at each time et.edited make it true



来源:https://stackoverflow.com/questions/4304075/how-can-i-get-edittext-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!