Home>

Tell me how to make a listener of changing the text in EditText. Moved code in After, also does not work. I put Bryaki into all three methods, none did not stop the application. But at the same time in debug it is clear that the listener is hanging.

mbinding.registerinputcode.addtextchangedlistener (Object: TextWatcher {
            Override Fun BeforetextChanged (P0: CHARSEQUENCE?, P1: INT, P2: INT, P3: INT) {
            }
            Override Fun OnTextChanged (P0: CHARSEQUENCE?, P1: INT, P2: INT, P3: INT) {
                Val String= P0.Tostring ()
                if (string.length== 6) {
                    ENTERCODE ()
                }
            }
            Override Fun AfterTextChanged (P0: Editable?) {
            }
        })
    }