主要要使用一个正则过滤即可实现:
String regular = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"; mXEditText.setKeyListener(new DigitsKeyListener() { @Override public int getInputType() { return InputType.TYPE_TEXT_VARIATION_PASSWORD; } @Override protected char[] getAcceptedChars() { char[] ac = regular.toCharArray(); return ac; } });
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/aiops/3098.html