I have used this code to set textType = password.
mInputText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
I however it ruins my custom font for the editText.
How can I combine them both?
I have used this code to set textType = password.
mInputText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
I however it ruins my custom font for the editText.
How can I combine them both?
just set the type after setting the flags
public void setPasswordTextType() {
mInputText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
mInputText.setTypeface(MY_TYPE);
}
use android:inputType="textPassword"
Ex:
<EditText
android:id="@+id/et_password"
android:layout_width="170dp"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:password="true"
android:textSize="18sp" >
</EditText>