0

What do I need to fill in on the setKeyListener parameter so that it has the same behaviour like android:numeric="integer" on XML?

Snippet:

paymentAmount = new EditText(this);
paymentAmount.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, 
                                               LayoutParams.WRAP_CONTENT));
paymentAmount.setMinimumWidth(100);
paymentAmount.setKeyListener(???);
hectichavana
  • 1,436
  • 13
  • 41
  • 71

1 Answers1

1

Have you seen EditText Input type Issue which recommends using an InputFilter. Here is an example taken from the previous question I linked.

Community
  • 1
  • 1
Jack
  • 9,156
  • 4
  • 50
  • 75