@AfterPreferences protected void init() { sp = PreferenceManager.getDefaultSharedPreferences(getActivity()); bindPreferenceSummaryToValue(findPreference("oci_key_preference")); bindPreferenceSummaryToValue(findPreference("mcc_filter_preference")); bindPreferenceSummaryToValue(findPreference("mnc_filter_preference")); bindPreferenceSummaryToValue(findPreference("ext_db_preference")); // only enable settings when the database download is not running setPreferencesEnabled(false); spiceManager.addListenerIfPending(DownloadSpiceRequest.Result.class, DownloadSpiceRequest.CACHE_KEY, new PendingRequestListener<DownloadSpiceRequest.Result>() { @Override public void onRequestNotFound() { setPreferencesEnabled(true); } @Override public void onRequestFailure(SpiceException spiceException) { setPreferencesEnabled(true); } @Override public void onRequestSuccess(DownloadSpiceRequest.Result result) { setPreferencesEnabled(true); } }); }
@AfterPreferences void initPrefs() { setProfitSummary(); setUnitSummary(); }