android edittext onchange listener

前端 未结 9 2208
长情又很酷
长情又很酷 2020-11-27 13:28

I know a little bit about TextWatcher but that fires on every character you enter. I want a listener that fires whenever the user finishes editing. Is it possib

9条回答
  •  忘掉有多难
    2020-11-27 13:35

    As far as I can think bout it, there's only two ways you can do it. How can you know the user has finished writing a word? Either on focus lost, or clicking on an "ok" button. There's no way on my mind you can know the user pressed the last character...

    So call onFocusChange(View v, boolean hasFocus) or add a button and a click listener to it.

提交回复
热议问题