Preference setSummary - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Preference setSummary method.

This code example shows how to use the following methods:setSummary
        /* we only have ListPreferences, so know newValue is a string */ 
        ListPreference list = (ListPreference) pref;
        String value = (String) newValue;
 
        if (Settings.System.putString(getContentResolver(), list.getKey(), value)) {
            pref.setSummary(findEntryForValue(list, value));
        } 
 
        return true; 
    } 
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setOnPreferenceClickListener, setSummary, Preference.setIcon, Preference.setTitle
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDefaultValue, setKey, setSummary, setTitle
This code example shows how to use the following methods:setDefaultValue, setKey, setOnPreferenceChangeListener, setSummary, setTitle
This code example shows how to use the following methods:setText, setSummary
        Imps.ProviderSettings.QueryMap settings = new Imps.ProviderSettings.QueryMap(cr,
                mProviderId, false /* keep updated */, null /* no handler */);
        String text;
 
        text = settings.getXmppResource();
        mXmppResource.setText(text);
        if (text != null) {
            mXmppResource.setSummary(text);
        } 
        text = Integer.toString(settings.getXmppResourcePrio());
        mXmppResourcePrio.setText(text);
        if (text != null) {
            mXmppResourcePrio.setSummary(text);
        } 
        text = Integer.toString(settings.getPort());
        mPort.setText(text);
        if (text != null && text != "5222" && text != "0") {
            mPort.setSummary(text);
        } 
        text = settings.getServer();
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setSummary
        setAppSummary(mCustomLongSearchAppActivityPref, Settings.System.USE_CUSTOM_LONG_SEARCH_APP_ACTIVITY);
    } 
 
    private void setAppSummary(Preference pref, String key) {
        String value = Settings.System.getString(getContentResolver(), key);
        pref.setSummary(mPicker.getFriendlyNameForUri(value));
    } 
 
    public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
        boolean value;
        if (preference == mCustomSearchAppTogglePref) {
            value = mCustomSearchAppTogglePref.isChecked();
            Settings.System.putInt(getContentResolver(),
                    Settings.System.USE_CUSTOM_SEARCH_APP_TOGGLE, value ? 1 : 0);
            return true; 
        } else if (preference == mCustomLongSearchAppTogglePref) {
            value = mCustomLongSearchAppTogglePref.isChecked();
            Settings.System.putInt(getContentResolver(),
                    Settings.System.USE_CUSTOM_LONG_SEARCH_APP_TOGGLE, value ? 1 : 0);
            return true; 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setSummary
				// the preference's 'entries' list. 
				ListPreference listPreference = (ListPreference) preference; 
				int index = listPreference.findIndexOfValue( stringValue ); 
 
				// Set the summary to reflect the new value. 
				preference.setSummary( index >= 0 ? listPreference.getEntries()[index] : null ); 
 
			} 
 
			else 
			{ 
				// For all other preferences, set the summary to the value's 
				// simple string representation. 
				preference.setSummary( stringValue ); 
			} 
			return true; 
		} 
	}; 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getContext, setSummary
                // the preference's 'entries' list. 
                ListPreference listPreference = (ListPreference) preference; 
                int index = listPreference.findIndexOfValue(stringValue); 
 
                // Set the summary to reflect the new value. 
                preference.setSummary( 
                        index >= 0 
                                ? listPreference.getEntries()[index] 
                                : null); 
 
            } else if (preference instanceof RingtonePreference) { 
                // For ringtone preferences, look up the correct display value 
                // using RingtoneManager. 
                if (TextUtils.isEmpty(stringValue)) { 
                    // Empty values correspond to 'silent' (no ringtone). 
                    // preference.setSummary(R.string.pref_ringtone_silent); 
 
                } else { 
                    Ringtone ringtone = RingtoneManager.getRingtone( 
                            preference.getContext(), Uri.parse(stringValue)); 

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setOnPreferenceClickListener, setSummary, Preference.setIcon, Preference.setTitle
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setKey, setSummary, setTitle, setChecked
    	strSavedPassword = preferences.getString("master_password", null);
    	bolAutoLoggout = preferences.getBoolean("auto_loggout", true);
    	//set saved values 
    	editUsername.setText(strSavedUsername);
    	editPassword.setText(strSavedPassword);
    	autoLoggout.setChecked(bolAutoLoggout);    	
    } 
     
    private void SaveSettings() { 
    	if (autoLoggout.isChecked() == false) {
    		Toast.makeText(getBaseContext(), "Auto Close disabled. Please be sure to close vault when done or else the vault stays open.", Toast.LENGTH_LONG).show();
    	} 
    	 
    	//check for removing password 
    	if (removeLogin.isChecked() == false) {
    		try { //get data from form 
    			strSavedUsername = editUsername.getText().toString();
        	} catch (Exception e) {
        		strSavedUsername = "";
        	} 

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Preference setSummary Questions & Answers:

setSummary Method Overview
Sets the summary for this Preference with a resource ID.
See Code Examples for other Android Preference Methods: