EditText with Mask

1

I needed a mask for a horimetro of tractor with 5 fields a comma and another one capo later. Example: "#####,#" I even found a cool MaskEdit, follow the link: link
The only problem is that I need the 'hint' of EditText to have the text "Horimetro *" and it ends up that the mask eats the characters of the hint causing it to be "Horim,e" I would like to know if there is a solution for this or if there is some other MaskEdit that works for me

    
asked by anonymous 25.07.2017 / 20:16

1 answer

0

Try to use a TextWatcher and place the hint in your XML. Here is an example of a zip mask:

EditText edtTextCEP = (EditText) findViewById(R.id.edt_txt_cep);    
TextWatcher textWatcherCep = Mask.insert("#####-###", edtTextCEP);
edtTextCEP.addTextChangedListener(textWatcherCep);
    
26.07.2017 / 15:53