How can I do something, 0.5 second after text changed in my EditText?

前端 未结 14 1193
渐次进展
渐次进展 2020-12-23 08:49

I am filtering my list using an EditText. I want to filter the list 0.5 second after user has finished typing in EditText. I used the afterTextChanged

14条回答
  •  既然无缘
    2020-12-23 09:28

    You can use EditorActionListener for that purpose.

    editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                //Do something here
                return true;
            }
            return false;
        }
    });
    

提交回复
热议问题