Just noticed that android:password has been deprecated, and we should be using android:inputType. Was experimenting with it by setting in my xml
android:inputType="textPassword"
Indeed it behaves like
android:password="true"
for EditText, but it seems that if I use android:inputType, android:hint will not work. The EditText will be blank. There is no such issues when using android:password with android:hint. Am I missing something here about android:inputType?
android:hint="Enter your question" or something like this must work. I am using Relative layout with EditText as If you want to use password,say android:inputType="textPassword" for hiding characters and "textVisiblePassword" for showing what you enter as password.
Here is your answer. We can use both simultaniously. As i used both and they are working fine. The code is as follows:
This will help you.
Hint text not bold, I try to below code.
When I change
inputtype=email
, other edittext is bold. But when I change input type topassword
, hint is normal.I need hint text to be bold, my code is:
Just stumbled on the answer.
android:inputType="textPassword"
does work withandroid:hint
, same asandroid:password
. The only difference is when I useandroid:gravity="center"
, the hint will not show if I'm usingandroid:inputType
. Case closed!I had the same issue and found a solution :
Previous code:
Solution:
The previous code does not show the 'hint', but when I changed it to the last one it started showing...
hope this be helpful to someone...
If you set
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
property which allows you to enter any type of password without any restriction.
If you want to provide hint use
example: