Try android:inputType="textPassword"
:
<EditText
android:id="@+id/password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPassword"
tools:text="12345" />
Programatically:
password.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
Or:
password.setTransformationMethod(PasswordTransformationMethod.getInstance());
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…