2

I want to show the 'only digits' keyboard when user taps on the editText. This can be achieved by

android:inputType="phone"
android:digits="0123456789"

I also want my editText to hide the content. Which can be achieved by

android:inputType="numberPassword"

I tried to do both combined by doing:

android:inputType="phone"
android:digits="0123456789"
android:password="true"

This worked but android:password="true" is deprecated. Is this possible to achieve in any other way?

Srujan Barai
  • 2,295
  • 4
  • 29
  • 52

1 Answers1

0

try this:

 android:inputType="number|numberPassword"

or you can also do this:

 android:inputType="phone|numberPassword"
Parsania Hardik
  • 4,593
  • 1
  • 33
  • 33