We are setting the inputType of an EditText programmatically to either support decimal or non-decimal numbers:
editText.inputType = if (isDecimal) InputType.TYPE_CLASS_NUMBER or InputType.TYPE_NUMBER_FLAG_DECIMAL else InputType.TYPE_CLASS_NUMBER
This works on most devices and opens the numeric keyboard either with or without the decimal separator. On some devices however it opens the alphanumeric keyboard instead, e.g. on a Moto G5 with 8.1.0 or Caterpillar S31 with Android 8.
How do we fix this, so that the numeric keyboard will always be opened?
Is by any chance Gboard Keyboard used on these phones?
Then please go to the PlayStore and check for Updates!