开发者

Password field in AlertDialog

I have created a alert dialog with edit text. How to set the property of the edittext as password?

Here is the code...

final AlertDialog.Builder alert = new AlertDialog.Builder(this);
final EditText input = new EditText(this);

input.setInputType(InputType.TYPE_CLASS_TEXT| InputType.T开发者_如何学GoYPE_TEXT_VARIATION_PASSWORD);

alert.setView(input);    //edit text added to alert
alert.setTitle("Password Required");   //title setted


input.setTransformationMethod(PasswordTransformationMethod.getInstance());
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜