private void update() { mSupportedMusicAppsList.removeAll(); mPrefsToMapisMap.clear(); mMapisToPrefsMap.clear(); MusicAPI[] mapis = MusicAPI.all(this); for (MusicAPI mapi : mapis) { CheckBoxPreference appPref = new CheckBoxPreference(this, null); appPref.setTitle(mapi.getName()); appPref.setPersistent(false); appPref.setChecked(mapi.isEnabled()); mSupportedMusicAppsList.addPreference(appPref); mPrefsToMapisMap.put(appPref, mapi); mMapisToPrefsMap.put(mapi, appPref); setSMASummary(appPref, mapi); } // explanation text, for what this screen does Preference detect = new Preference(this); if (mapis.length == 0) detect.setTitle(R.string.no_supported_mapis_title); else if (mapis.length == 1) detect.setTitle(R.string.find_supported_mapis_one_title); else detect.setTitle(getString(R.string.find_supported_mapis_many_title) .replace("%1", Integer.toString(mapis.length))); detect.setSummary(R.string.find_supported_mapis_summary); mSupportedMusicAppsList.addPreference(detect); }
CheckBoxPreference checkbox = new CheckBoxPreference(this); checkbox.setKey(overlay.getId()); checkbox.setPersistent(true); checkbox.setTitle(overlay.getTitle(language)); if (findPreference(overlay.getId()) == null) {
overview.setKey(settings.getInOverviewGraphKey()); overview.setTitle(R.string.label_include_in_overview_graph); overview.setPersistent(true); overview.setDefaultValue(settings.isInOverviewGraph()); screen.addPreference(overview); estimate.setTitle(R.string.label_estimate_measurement); estimate.setSummary(R.string.label_estimate_measurement_summary); estimate.setPersistent(true); estimate.setDefaultValue(settings.isEstimationEnabled()); screen.addPreference(estimate);