Search code examples
androidandroid-edittextpasswordsandroid-inputtype

inputType doesn't hide the password


I have set attribute android:inputType in EditText

android:inputType="textWebPassword"` 

but it still shows the password I'm entering. Is there anything else(or instead) that should be done?

 android:layout_width="match_parent"
 android:layout_height="@dimen/button_height"
 android:background="@drawable/background_edit"
 android:ems="10"
 android:gravity="center"
 android:hint="@string/new_pass_hint"
 android:inputType="textWebPassword"
 android:textColor="@color/edit_text_text_color"
 android:textColorHint="@color/edt_text_hint_color"
 android:textSize="@dimen/button_text_size"

Solution

  • Try this please

    Edttext.setTransformationMethod(PasswordTransformationMethod.getInstance());
    

    then this in your layout

    android:password="true"