Reputation: 177
In my app I need to add a number row to the Android keyboard, it is possible?, how?
Upvotes: 1
Views: 1862
Reputation: 12615
You can't control the keyboard layout, Keyboards may display different layouts based on the input type you provide with the input field. You'll just need to provide the correct android:inputType
and let the Keyboard handle it for you.
Also as per the documentation, you can't mix classes together but classes may be combined with variations and flags to indicate desired behaviors. So setting inputType
to number|text
will not work and will only display a numeric keypad.
There are two tricks which might work on some Keyboards:
android:inputType="textVisiblePassword"
OR
editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS)
Upvotes: 3