Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final EditText Your_EditText = (EditText)findViewById(R.id.your_edittext_id);
- final CheckBox Your_CheckBox = (CheckBox)findViewById(R.id.your_checkbox_id);
- Your_CheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
- if(b)
- Your_EditText.setInputType(InputType.TYPE_CLASS_TEXT);
- else
- Your_EditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement