setOnKeyListener not responding

后端 未结 6 1035
执念已碎
执念已碎 2021-01-05 17:43

I am new to Android and working through a to do list example from a book. I have one Activity which is displaying an EditText and a ListView beneath it. There is an onKey ev

6条回答
  •  悲&欢浪女
    2021-01-05 18:17

    Following code solved such problem: You just need to need to add addTextChangedListener like this.Rest is self- explanatory

        editabltText.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
    
            }
    
            @Override
            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
    
            }
    
            @Override
            public void afterTextChanged(Editable editable)
            {
    
    
            }
        });
    

提交回复
热议问题