Hello there,

i'm developing a password manager for android.
I have one Activity that displays the details of an entry.
by default all edittext elements of this view are disabled and the
edittext that shows the actual password of this entry has the
android:password="true" attribute assigned in the xml file of this
view.
Now i have a togglebutton at the bottom of the view which can dis/
enable all edittext elements to modify the entry.

My problem is:
i cannot find a way to change the password value of the password
field.
what i want is:
when the togglebutton isn't checked, the password field should show
only dots.
if the user pressed the button, this field should show the password in
cleartext.


the following doesn't work:

editBtn.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
                lockOrUnlockEntry(editBtn.isChecked());
                if (editBtn.isChecked()) {
                        passPass.setInputType(InputType.TYPE_CLASS_TEXT);
                } else {
                        passPass.setTransformationMethod(new
PasswordTransformationMethod());
                        
passPass.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
                }
        }
});

private void lockOrUnlockEntry(boolean b) {
        passTitle.setEnabled(b);
        passTitle.setFocusable(b);
        passURL.setEnabled(b);
        passURL.setFocusable(b);
        passUser.setEnabled(b);
        passUser.setFocusable(b);
        passCompany.setEnabled(b);
        passCompany.setFocusable(b);
        passPass.setEnabled(b);
        passPass.setFocusable(b);
        passNotes.setEnabled(b);
        passNotes.setFocusable(b);
}


any suggestions?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to