0

I have a dialog box that i have created. this is the code for edittext box. but i want the text to be like password textbox. what change can i do?

android:inputType="textPassword"   


final EditText input = new EditText(Setting.this);
                LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
                                        LinearLayout.LayoutParams.MATCH_PARENT,
                                        LinearLayout.LayoutParams.MATCH_PARENT);
                  input.setLayoutParams(lp);
4

2 回答 2

1

May be this

EditText dt = new EditText(this);
dt.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);

Set inputType for an EditText?

于 2013-09-21T10:34:11.873 回答
0
input.setInputType(InputType.TYPE_CLASS_TEXT | inputType.TYPE_TEXT_VARIATION_PASSWORD);
于 2013-09-21T10:37:19.913 回答