Android EditText for password with android:hint Android EditText for password with android:hint xml xml

Android EditText for password with android:hint


Hint is displayed correctly with

android:inputType="textPassword"

and

android:gravity="center"

if you set also

android:ellipsize="start"


Just stumbled on the answer. android:inputType="textPassword" does work with android:hint, same as android:password. The only difference is when I use android:gravity="center", the hint will not show if I'm using android:inputType. Case closed!


Here is your answer. We can use both simultaniously. As i used both and they are working fine. The code is as follows:

<EditText    android:id="@+id/edittext_password_la"    android:layout_below="@+id/edittext_username_la"    android:layout_width="fill_parent"    android:layout_height="wrap_content"    android:layout_margin="15dip"    android:inputType="textPassword"    android:hint="@string/string_password" />

This will help you.