Skip to content Skip to sidebar Skip to footer

How To Determine If Someone Is Typing On Edittext

I am designing a chat application using android studio and i am using fire-base as cloud service provider and i got stock on how to make a listener like if the user is typing on th

Solution 1:

Implement the TextWatcher on your edittext like this

EditTextmyTextBox= (EditText) findViewById(R.id.myTextBox);
  myTextBox.addTextChangedListener(newTextWatcher() {

   publicvoidafterTextChanged(Editable s) {
   }

   publicvoidbeforeTextChanged(CharSequence s, int start, 
     int count, int after) {
   }

   publicvoidonTextChanged(CharSequence s, int start, 
     int before, int count) {
   // Here you can trigger your another code/function about which you are asking
   }
  });

Hope it will help!

Solution 2:

Post a Comment for "How To Determine If Someone Is Typing On Edittext"