Java 类org.androidannotations.annotations.AfterPreferences 实例源码

项目:Local-GSM-Backend    文件:AdvancedSettingsFragment.java   
@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);
        }
    });
}
项目:Produce-Price-Checker    文件:SettingsActivity.java   
@AfterPreferences
void initPrefs() {
    setProfitSummary();
    setUnitSummary();
}