Code example for PasswordTransformationMethod

0
            // This informs the keyboard not to show up the autocomplete. 
            // Ensure that you have set this input type, otherwise users 
            // may complain that your application is saving their passwords. 
            field.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
            // This gives us the masking that you see in your password fields 
            field.setTransformationMethod(new PasswordTransformationMethod());
        } 
        // We still return false so that the system will handle everything else. 
        // We just needed to ensure that if this preference is the password pref 
        // that it's properly protected from prying eyes. 
        return false; 
    } 
    protected void onPause() { 
    	super.onPause(); 
    	AbstractWidgetProvider.setAlarm(this);
    } 
	@Override 
	public boolean onPreferenceChange(Preference preference, Object newValue) {
		String key = preference.getKey();
		if (key.equals("username") || key.equals("password")) {
			// If the changed preference is the username or password, set the result so that when we exit,