Example usage for android.preference EditTextPreference getSummary

List of usage examples for android.preference EditTextPreference getSummary

Introduction

In this page you can find the example usage for android.preference EditTextPreference getSummary.

Prototype

public CharSequence getSummary() 

Source Link

Document

Returns the summary of this Preference.

Usage

From source file:com.hichinaschool.flashcards.anki.Preferences.java

private void updateEditTextPreference(String key) {
    EditTextPreference pref = (EditTextPreference) getPreferenceScreen().findPreference(key);
    String entry;/*from  w ww.  j  a v a  2s . com*/
    try {
        entry = pref.getText();
    } catch (NullPointerException e) {
        Log.e(AnkiDroidApp.TAG, "Error getting set preference value of " + key + ": " + e);
        entry = "?";
    }
    if (mListsToUpdate.containsKey(key)) {
        pref.setSummary(replaceString(mListsToUpdate.get(key), entry));
    } else {
        String oldsum = (String) pref.getSummary();
        if (oldsum.contains("XXX")) {
            mListsToUpdate.put(key, oldsum);
            pref.setSummary(replaceString(oldsum, entry));
        } else {
            pref.setSummary(entry);
        }
    }
}