Edittext set for password with phone number input? (android)?

Android:password is deprecated, but AFAIK is the only way because android:inputType="phone|textPassword is ignored.

Android:password is deprecated, but AFAIK is the only way because android:inputType="phone|textPassword" is ignored ...

Ah, interesting. I hadn't seen that it's deprecated. Here's the documentation that mentions inputType is the way to go (as Roman mentions): developer.android.Com/reference/android/R.attr.

Html#password – Christopher Jan 7 '10 at 2:19 Thanks dtmilano. – Portablejim Jan 7 '10 at 2:49.

This problem can be solved without using deprecated android:password. See my answer here.

I have not found an appropriate solution to this problem. Dtmilano's accepted solution doesn't fully work. If the EditText is focused in landscape mode where you have the full screen keyboard, the numbers still display in clear text, not masked.

I spent significant time going through the actual TextView code, and the reason this is a problem is that they are explicitly checking the InputType against InputType. TYPE_CLASS_TEXT and, if I recall correctly, TYPE_MASK_CLASS. So if you include any other InputType within those bounds (I think the range used by TYPE_CLASS_TEXT and TYPE_MASK_CLASS is the first byte), then it won't be recognized as a password that needs masking.

I know what I said is pretty confusing. The actual code is a LOT more confusing. I was pretty appalled at the TextView's code to be honest.It's a tangled mess, with hard coded checks everywhere.

Horrible coding practice which leads to problems like this.

I haven't tried this, but it might be possible to combine the two like so: android:inputType="textPassword|phone" since inputType can take on multiple values.

It does not work. The EditText is ignoring the textPassword and just setting to phone – Portablejim Jan 7 '10 at 2:48 1 Sorry about that, my answer was just an educated guess without testing.. dtmilano's snippet looks to be the right way to go. – Roman Nurik Jan 7 '10 at 20:00.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions