How to get a keyboard password passwords in Android?

I need a numeric keypad on the EditText PIN. I tried to use

 android:inputType="number|textPassword" 

This calls up the numeric keypad, but the characters are not password characters.

How to get a numeric keypad with password characters in EditText mode?

The application runs on 2.2 and higher.

+4
source share
4 answers

You should look here: is Edittext set to enter a password with a phone number? (Android)

It says android:password deprecated, but this is the only way because android:inputType="phone|textPassword" ignored ...

 <EditText android:id="@+id/EditText01" android:layout_height="wrap_content" android:layout_width="fill_parent" android:password="true" android:inputType="phone" /> 
+3
source

In my .xml styles, these two seem to work for me:

 <item name="android:inputType">numberPassword</item> <item name="android:password">true</item> 
+1
source

It works:

  <EditText android:id="@+id/pinEdit" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="4dp" android:digits="1234567890" android:inputType="textPassword" android:maxLength="4" > <requestFocus /> </EditText> 

If the numbers will work for you.

EDIT: Ah, I see, he doesn’t pick up the number pad .... back to the drawing board.

0
source

Usage: "numberSigned | numberPassword"

0
source

Source: https://habr.com/ru/post/1439873/


All Articles