Preference getExtras - 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 getExtras method.

This code example shows how to use the following methods:getExtras, getFragment, getTitleRes
    } 
 
    @Override 
    public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
        // Override the fragment title for Wallpaper settings 
        int titleRes = pref.getTitleRes();
 
        startPreferencePanel(pref.getFragment(), pref.getExtras(), titleRes, null, null, 0);
        return true; 
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:getExtras, setSummary
    } 
 
    private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() {
        public boolean onPreferenceChange(Preference preference, Object value) { 
            String stringValue = value.toString(); 
            String suffix = preference.getExtras().getString("suffix", ""); 
 
            if (preference instanceof ListPreference) { 
                ListPreference listPreference = (ListPreference) preference; 
                int index = listPreference.findIndexOfValue(stringValue); 
 
                preference.setSummary( 
                        index >= 0 
                                ? listPreference.getEntries()[index] + suffix 
                                : null); 
 
            } else { 
                preference.setSummary(stringValue + suffix); 
            } 
            return true; 

5
CodeRank
This code example shows how to use the following methods:getExtras, getFragment, getTitleRes
    } 
 
    @Override 
    public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
        // Override the fragment title for Wallpaper settings 
        int titleRes = pref.getTitleRes();
 
        startPreferencePanel(pref.getFragment(), pref.getExtras(), titleRes, null, null, 0);
        return true; 
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:getExtras, getKey
    } 
 
    @SuppressWarnings("deprecation") 
    @Override 
    public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
        String key = preference.getKey();
        boolean folder = preference.getExtras().getBoolean("FOLDER");
 
        if (folder) {
 
            CURRENT_FOLDER = preference.getExtras().getString("PATH");
            BROWSING_ALL = preference.getExtras().getBoolean("BROWSING_ALL");
            search(key);
 
        } else { 
 
            final PackageInfo info = mInfos.get(key);
 
            runOnUiThread(new Runnable() {
 
4
CodeRank
This code example shows how to use the following methods:getExtras
        alert.setNegativeButton(android.R.string.ok, new DialogInterface.OnClickListener() {
 
            public void onClick(DialogInterface dialog, int whichButton) {
                dialog.dismiss();
 
                File file = new File(preference.getExtras().getString("filePath"));
                sFiles.remove(file);
                update(); 
            } 
        }); 
        alert.show();
    } 
} 
4
CodeRank
getExtras Method Overview
Return the extras Bundle object associated with this preference, creating a new Bundle if there currently isn't one.
See Code Examples for other Android Preference Methods: