0

In my application I have an EditText (Actually it's an implementation of MultiAutoCompleteTextView, but I don't think that matters) in which the user can enter a formula to be calculated, although generally they will want to just enter an integer.

What I would really like is for the keyboard to open with the numeric keyboard showing, but allow them to change to text if they want. As standard of course it shows the letters and allwos them to change to numbers, which is OK, but 90% of the time they will want the numbers.

I tried doing:

 operandEditText.setInputType(InputType.TYPE_CLASS_NUMBER|
 InputType.TYPE_NUMBER_FLAG_SIGNED|InputType.TYPE_CLASS_TEXT);

But the result was a numeric keypad with letters written on the number keys (like a phone keypad), and it didn't write letters anyway.

I'm also aware that I could add a button, spinner or something that changed the input mode of the widget, but the aim of this is to make the interface easier to use, and I'm not sure adding another control will achieve that.

Is there a way to make it do what I want?

Padma Kumar
  • 19,893
  • 17
  • 73
  • 130

0 Answers0