Skip to content Skip to sidebar Skip to footer

Addtextchangedlistener Works For One Edittext But Not For The Other

I am asking this question after going through every possible way of resolving it. I have two EditText defined as follows private EditText firstText; private EditText secondText; I

Solution 1:

You do as like

    mSearchbox.addTextChangedListener(newTextWatcher() {
        @OverridepublicvoidonTextChanged(CharSequence cs, int start, int before, int count) {
            ivCancelSearch.setVisibility(mSearchbox.getText().length() > 0 ? View.VISIBLE : View.GONE);
        }

        @OverridepublicvoidbeforeTextChanged(CharSequence s, int start, int count, int after) {
        }

        @OverridepublicvoidafterTextChanged(Editable s) {

        }
    });

similer for other remember get correct id of edittext

Post a Comment for "Addtextchangedlistener Works For One Edittext But Not For The Other"