BVtp
BVtp

Reputation: 2480

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"

Upvotes: 2

Views: 1070

Answers (3)

Mrad Mrad
Mrad Mrad

Reputation: 542

Try this please

Edttext.setTransformationMethod(PasswordTransformationMethod.getInstance());

then this in your layout

android:password="true"

Upvotes: 3

Kishore Jethava
Kishore Jethava

Reputation: 6834

it should be textPassword look at this

<EditText
 android:id="@+id/edtPassword"
 android:layout_width="fill_parent"
 android:layout_height="42dp"
 android:layout_marginTop="16dp"
 android:hint="Password"
 android:inputType="textPassword"
 android:padding="5dip"
 android:singleLine="true"
 android:textColor="#363435"
 android:textSize="14sp" />

Upvotes: 0

Narendra Singh
Narendra Singh

Reputation: 4001

You must set

android:password="true"

Upvotes: 0

Related Questions