How to delete instantly SPACE from an edittext if a user presses the space?
I have an edittext, and a textwatcher that watches if SPACE arrived or not. If its a SPACE I would like to delete that instantly. Or if its a space I want to make sure it doesnt appear but indicate somehow (seterror, toast) for the user that space is not allowed. edittext.addTextChangedListener(new TextWatcher() { public void afterTextChanged(Editable s) { //---// } public void beforeTextChanged(CharSequence s, int start, int count, int after) {} public void onTextChanged(CharSequence s, int start, int before, int count) {} }); I cannot define onkeydown in the afterTextChaned method, since it