Search code examples
androidxmlandroid-softkeyboardandroid-inputtype

Display keyboard for numers when inputType set to 'text'


I would like to display for users keybaord with numbers, dot and comma when my input place field is set to <item name="android:inputType">text</item>.

I don't want set inputType for numberDecimal cause it do not accept comma. Or maybe there is other way to force user to use comma instead of dot when entering floats?

Greetings


Solution

  • You can use this but you need to handle invalid input yourself or add TextWatcher to check for input while typing

    android:inputType="number"
    android:digits="0123456789,."