我想添加屏蔽......如00000-0000000-0
etusercnic.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { try { String str = s.toString(); if (s.length() == 5 || s.length() == 13) { str += "-"; etusercnic.setText(str); etusercnic.setSelection(str.length()); } } catch (Exception ignored) { } } @Override public void afterTextChanged(Editable s) { } });
当我第一次输入值时,它完美地工作,但是当我删除它放置的任何数字时 - 签名.那我该怎么办..