EditText et = (EditText) findViewById(......); et.setInputType(InputType.TYPE_CLASS_NUMBER); et.setTransformationMethod(PasswordTransformationMethod.getInstance()); Don't reverse the sequence of the above 2 calls.
You can check the TextView.java to see how Android judges whether the EditText is password-mode if you are interested. 2009/12/31 csyperski <[email protected]> > Does anyone know how to do a EditText that should have hidden input, > but also be numeric? I tried using: > > Input Type = textPassword|number > > But this doesn't seem to work? I know it is easy to do with the > deprecated xml properties, but I want to stay away from them. > > Thanks in advance for any help you can provide! > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

