edittext-mask
edittext-mask copied to clipboard
Is there way to set mask programmatically?
Is there way to set mask programmatically? (mask:mask="+7(###)###-##-##")
Hi! You can apply the mask programmatically with this :
inputEditText.setMask("##.###.###");
But the mask will not get applied until you set some text. Personally I fix that problem by calling setText("")
right after setting the mask.
Also, if you want a hint to be applied on the mask you can use
inputEditText.setKeepHint(true);
inputEditText.setHint("00000");
bertween the call to setMask(...) and setText(...).