N1NG4
N1NG4

Reputation: 171

Android - Add extra character in input type Number

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?

Upvotes: 1

Views: 900

Answers (1)

PioSwi
PioSwi

Reputation: 458

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

Upvotes: 3

Related Questions