Where can I see exactly what Xml Attributes do codewise (TextView)?
<p><a href="http://developer.android.com/reference/android/widget/TextView.html#attr_android:password" rel="nofollow">http://developer.android.com/reference/android/widget/TextView.html#attr_android:password</a></p>

<p>I can't find where in the android code it applied the android:password xml attribute. Basically, I want to set the TransformationMethod manually in code instead of using the XML Attribute. If I call:</p>

<pre><code>TextView.setTransformationMethod(new PasswordTransformationMethod())
</code></pre>

<p>Then what happens is the TextView will correctly mask the characters, until the TextView is focused on in landscape orientation where it's just a full screen keyboard with the text that you're entering. In that screen, the text is in plain text. So obviously, the XML Attribute android:password is doing more than just setting the Transformation Method. Can anyone point me to where the XML Attributes are interpreted in the Android code, or tell me what else I need to do to mask the characters correctly?</p>

<p>The reason I can't use the XML Attribute is because I'm doing some specific character masking, where I want hyphens in plain text, while masking everything else (***-**). To do this, I have extended the PasswordTransformationMethod to basically ignore hyphens, so I have to call the TransformationMethod setter manually in the code.</p>

<p>Update: So I think I found the problem. In <a href="http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.3_r1/android/widget/TextView.java#2959" rel="nofollow">TextView.setInputType(int type)</a>, it sets the TransformationMethod to PasswordTransformationMethod depending on the InputTypes passed in. TextView exclusively allows the InputType combination of (InputType.TYPE_TEXT_VARIATION_PASSWORD | InputType.TYPE_CLASS_TEXT) to represent a masked password. If you have any other InputTypes added, it will classify it as not a password... very frustrating.</p>

<p>Anyway, the problem is that at the end of <a href="http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3.3_r1/android/widget/TextView.java#2959" rel="nofollow">TextView.setInputType(int type)</a>, it calls </p>

<pre><code>InputMethodManager imm = InputMethodManager.peekInstance();
if (imm != null) imm.restartInput(this);
</code></pre>

<p>Which is what I believe is setting the full screen keyboard view's TransformationMethod. This would be fine, if only it didn't set the TransformationMethod to PasswordTransformationMethod earlier in the same method, overwriting whatever I had set it to previously.</p>

<p>To compound problems, for some reason I can't seem to access any of InputMethodManager's static functions like peekInstance(). What I had tried to do is extend EditView, and override setInputType(int type). But, for some odd reason, I can't call the same InputMethodManager code noted above, and I'm guessing that call is what the full screen keyboard's view uses to set it's TransformationMethod...</p>

<p>I'm getting extremely frustrated with Android's class design. They hard code stuff like setting the PasswordTransformationMethod in several places strictly by doing comparisons to the InputTypes, which are extremely confusing (bitwise comparisons, etc). And there's no way to override their private isPasswordInputType checks to change the definition of what a "Password" is manually...</p>
