Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EditText cpfeditText = (EditText) findViewById(R.id.cpf_edit_text);
- InputFilter[] cpfFilters = {new InputFilter() {
- @Override
- public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
- if (dest.length() == 14) {
- Toast.makeText(HomeActivity.this, "Limite de caracteres atingido DO CPF ", Toast.LENGTH_SHORT).show();
- return "";
- }
- return null;
- }
- }};
- cpfeditText.setFilters(cpfFilters);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement