1

What I want - I am creating an Android app in which I want to take user input in numbers and a extra character 'x'. With the help of extra character Users can Enter Patterns.

Example -636xxx75755xx65

Problem I've - I want to show only numbers keyboard with a extra character. I don't want to show whole keyboard with all characters... Is there any solution for it?

N1NG4
  • 171
  • 1
  • 2
  • 8

1 Answers1

3

I don't think there is an out of the box solution for this. In my opinion you have two options:

  • Show the full keyboard (numbers + letters) and prohibit the user of entering any other characters than numbers and 'x' (obviously you should inform the user that only character 'x' is accepted) by using an InputFilter on the EditText -> see for example: https://stackoverflow.com/a/21828520/7703505
  • implement a custom keypad using default Android buttons in your Activity/Fragment layout
PioSwi
  • 406
  • 2
  • 10