1

I'am using TextWatcher and onTextChanged, but when my screen scrolled it's provoke my function in editText change.

holder.editTextCrt.addTextChangedListener(new TextWatcher() {
    boolean mToggle = false;
    boolean mToggle2 = false;

    public void onTextChanged(CharSequence s, int i, int i1, int i2) {
        if (mToggle) {
            if (mToggle2) {
                 if(s.length() != 0){
                    Log.d(TAG, "onTextChanged: HIT KEY" + holder.editTextCrt.getText().toString());
                 }
            }
            mToggle2 = !mToggle2;
        }
        mToggle = !mToggle;
    }
}

I have Costume Adapter for listview inside activity. in this ListView has multiple line, each line has 4 box, i just wanna chech if in 3 of them whichever is set by user, then could read by system. And it's done, but problem occured that is when user scroll, then it read again in edit text(my textChange trigger again).

by this reference How the input method can request 'updateCursor' event? How i disable connection between Onchange in editText and ScrollView/position of crusor ?

I just wanna read the hit key didn't need notification when scroll, and i didn't set for editText receive trigger from screen scroll.

So can i disable it, or i make some mistake. Help me to understand of this matter..

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.