Code example for EditTextPreference

Methods: setSummary, setText

0
            value = prefs.getString(key, null);
            settings.setXmppResource(value);
            if (value != null) {
                value = value.trim();
                mXmppResource.setSummary(value);
                mXmppResource.setText(value); // In case it was trimmed
            } 
        } else if (key.equals("pref_account_xmpp_resource_prio")) {
             
            value = prefs.getString(key, "20");
            try { 
                settings.setXmppResourcePrio(Integer.parseInt(value));
            } catch (NumberFormatException nfe) {
                Toast.makeText(getBaseContext(),
                        "Priority must be a number in the range [0 .. 127]", Toast.LENGTH_SHORT)
                        .show(); 
            } 
            mXmppResourcePrio.setSummary(value);
        } else if (key.equals("pref_account_port")) {
            value = prefs.getString(key, "0");
            try {