Code example for EditTextPreference

Methods: getEditText

0
        freshTimePref.setOnPreferenceChangeListener(numberCheckListener);
    } 
    public boolean onPreferenceClick(Preference preference){
        if(preference.getKey().equals("password")){
            EditTextPreference pref = (EditTextPreference) preference;
            EditText field = pref.getEditText();
            // 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);