{ final InputFilter filter = new InputFilter() { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { for (int i = start; i < end; i++) { if (Character.isDigit(source.charAt(i))||Character.isLetter(source.charAt(i))) { return ""; } } return null; } }; answerTXT.setFilters(new InputFilter[]{filter}); }
輸入?那麼你可以在xml中嘗試不同的輸入類型 – whiteTIGER
ok..are要限制某些輸入的
– dreamcoder