Type password in android EditText

1

When entering the password, I want them to leave *, periods or something so that it is not visible. I have the following editText

<EditText
    android:id="@+id/edit1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" /> 

Does anyone know of any property or something for this?

    
asked by Carlos Sanchez 27.09.2018 в 17:52
source

1 answer

2

You can do what you want by specifying the android: inputType attribute and the constant textPassword in your EditText :

android:inputType="textPassword"

Example:

<EditText
        android:id="@+id/edit1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textPassword" />

when writing, the "*" character will be displayed:

You can review the documentation for more information on

Specifying the type of input method in an EditText

    
answered by 27.09.2018 / 17:55
source