Search code examples
androidandroid-edittextsamsung-mobilesamsung-galaxy

EditText inputType problems with Samsung A50


This works in a vast phone model list except for the Samsung A50:

<EditText
    ...
    android:digits="0123456789-"
    android:inputType="numberDecimal" />

enter image description here enter image description here

This is the "hotfix" work around:

<EditText
    ...
    android:digits="0123456789-"
    android:inputType="phone" />

Any idea, other than it's a Samsung, of the reason on why this is failing?


Solution

  • You can achieve this in a more exact way using below:

    android:digits="0123456789-"
    android:inputType="numberSigned"
    

    Output from A50S: