I have set input type to be numberdecimal but also want to populate the editText with a \"-\" programmatically. I can add the text but then I am unable to edit the text as it do
I was able to achieve this behavior by setting digits xml attribute as follows:
digits
Setting it up programatically (Set EditText Digits Programmatically):
weightInput.setKeyListener(DigitsKeyListener.getInstance("0123456789-"));