use of android.support.v7.preference.PreferenceManager in project materialistic by hidroh.
the class Preferences method sync.
private static void sync(PreferenceManager preferenceManager, String key) {
Preference pref = preferenceManager.findPreference(key);
if (pref instanceof ListPreference) {
ListPreference listPref = (ListPreference) pref;
pref.setSummary(listPref.getEntry());
}
}
use of android.support.v7.preference.PreferenceManager in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class PaymentSettings method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
mPaymentBackend = new PaymentBackend(getActivity());
setHasOptionsMenu(true);
PreferenceManager manager = getPreferenceManager();
PreferenceScreen screen = manager.createPreferenceScreen(getActivity());
List<PaymentBackend.PaymentAppInfo> appInfos = mPaymentBackend.getPaymentAppInfos();
if (appInfos != null && appInfos.size() > 0) {
NfcPaymentPreference preference = new NfcPaymentPreference(getPrefContext(), mPaymentBackend);
preference.setKey("payment");
screen.addPreference(preference);
NfcForegroundPreference foreground = new NfcForegroundPreference(getPrefContext(), mPaymentBackend);
screen.addPreference(foreground);
}
setPreferenceScreen(screen);
}
Aggregations