Show the password with EditText
问题 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()) { password.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); } else { password.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD); } } When it checked, it show password. But when it not checked, it does show stars. How to modify it to show star while the cb is not checked? 回答1: I don't know exactly the specifics, but this code