Example usage for android.preference Preference hasKey

List of usage examples for android.preference Preference hasKey

Introduction

In this page you can find the example usage for android.preference Preference hasKey.

Prototype

public boolean hasKey() 

Source Link

Document

Checks whether this Preference has a valid key.

Usage

From source file:net.sf.sprockets.app.ui.SprocketsPreferenceFragment.java

@Override
public boolean onPreferenceChange(Preference pref, Object newValue) {
    if (pref.hasKey()) {
        Managers.backup(a).dataChanged();
        if (Fragments.arguments(this).getBoolean(TRACK_CHANGES)) {
            event(mCategory, "set " + pref.getKey(),
                    pref instanceof EditTextPreference || pref instanceof RingtonePreference ? null
                            : newValue.toString());
        }/*from  w ww . j ava2 s  .c  o  m*/
    }
    return true;
}