Aung Phyo Zaw
Aung Phyo Zaw

Reputation: 17

EditText , want to appear typed text as stars ' * '

is there any way to convert text to star '*' especially passwords when we type text in Edit Text filed .

Upvotes: 0

Views: 598

Answers (2)

Hrafn
Hrafn

Reputation: 2946

EditText has the built in attribute android:inputType which allows you to set the type of input that the the field is accepting.

For instance if you set it to android:inputType="phone" then the keyboard will only display characters related to making a phonecall.

You can also set it to android:inputType="textPassword" which will then cause the field to automatically take care of obscuring the input when the user types into it.

You can find more detail in the official documentation here and here

Upvotes: 1

che10
che10

Reputation: 2308

Add the following to your EditText XML

android:inputType="textPassword"

Upvotes: 4

Related Questions