Code example for Editable

Methods: length, toString

0
            }}; 
        if (item.hasValue())
            updateEditText.run();
        textEditor.addTextChangedListener(new TextWatcher() {
            public void afterTextChanged(Editable s) {
                Object newVal = parseValue(s.length() == 0 ? null : s.toString());
                if (equal(newVal, item.getValue()))
                    return; 
                item.setValue(newVal);
                afterChange.run();
            } 
 
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
                // noop 
            } 
 
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                // noop 
            } 
        }); 
        return updateEditText;