Just noticed that android:password has been deprecated, and we should be using android:inputType. Was experimenting with it by setting in my xml
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!
If you set
android:inputType="textPassword"
this property and if you provide number as password example "1234567" it will take it as "123456/" the seventh character is not taken. Thats why instead of this approach use
android:password="true"
property which allows you to enter any type of password without any restriction.
If you want to provide hint use
android:hint="hint text goes here"
example:
android:hint="password"