Search code examples
androidandroid-keypad

Android : TYPE_CLASS_PHONE keypad issue


I want to show a kepyad only with following numbers and characters: *0123456789# , but when I am using

accessCodeEditText.setInputType(InputType.TYPE_CLASS_PHONE);

I have some another characters like +WNP()/-,. , how can I hide this extra characters from keypad?


Solution

  • change your EditText in xml file to:

    <EditText
        .
        .
        .
    android:inputType="phone" />