How do I get a Edittext with both a phone input and the ability to hide the string. I know that
android:inputType="textPassword"
hides the string, while
android:inputType="phone"
brings up a dialpad interface.
How to combine the two?
How do I get a Edittext with both a phone input and the ability to hide the string. I know that
android:inputType="textPassword"
hides the string, while
android:inputType="phone"
brings up a dialpad interface.
How to combine the two?
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.
android:password
is deprecated, but AFAIK is the only way because android:inputType="phone|textPassword"
is ignored ...
<EditText
android:id="@+id/EditText01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:password="true"
android:inputType="phone" />
This problem can be solved without using deprecated android:password
. See my answer here.