问题
How to block special characters in androids editText? by not using android:digits!!
is there any other way around, even programmatically?
回答1:
EditText has an onTextChanged listener, you can follow the characters the user is inputting and if the character is illegal you just delete it. Not the most elegant way, but hope it makes it. Good luck!
来源:https://stackoverflow.com/questions/5906744/how-to-block-special-characters-in-androids-edittext-no-androiddigits