I use an EditText to enter password. And a CheckBox to show password or not. Below function is the part:
public void ShowPassword() { if (cb.isChecked()) {
public void onCheckBox(View v2) { CheckBox cb = (CheckBox)this.findViewById(R.id.pass_Check); EditText et1=(EditText)this.findViewById(R.id.edt_Pass); if(cb.isChecked()) { et1.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); } else { et1.setInputType(129); } }