public void onCreatePreferences(Bundle bundle, String s) { Context preferenceContext = getPreferenceManager().getContext(); PreferenceScreen screen = getPreferenceManager().createPreferenceScreen(preferenceContext); screen.setTitle(R.string.settings_dialog_title); this.mRecommendationsPref = new Preference(preferenceContext); this.mRecommendationsPref.setTitle(R.string.recommendation_blacklist_action_title); this.mRecommendationsPref.setFragment(RecommendationsPreferenceFragment.class.getName()); screen.addPreference(this.mRecommendationsPref); Preference appsAndGames = new Preference(preferenceContext); appsAndGames.setTitle(R.string.home_screen_order_action_title); appsAndGames.setFragment(AppsAndGamesPreferenceFragment.class.getName()); screen.addPreference(appsAndGames); setPreferenceScreen(screen); }
screen.removeAll(); screen.setOrderingAsAdded(false); Preference preference = new Preference(context); preference.setLayoutResource(R.layout.pref_wall_of_text); preference.setSelectable(false);
String[] data = (_cu.readTextfileFromRawRes(R.raw.project_team, "", "").trim() + "\n\n").split("\n"); for (int i = 0; i + 2 < data.length; i += 4) { Preference person = new Preference(context); person.setTitle(data[i]); person.setSummary(data[i + 1]);
public void onCreatePreferences(Bundle bundle, String s) { Context preferenceContext = getPreferenceManager().getContext(); PreferenceScreen screen = getPreferenceManager().createPreferenceScreen(preferenceContext); screen.setTitle(R.string.home_screen_order_content_title); SortingModeManager.SortingMode sortingMode = SortingModeManager.getSavedSortingMode(preferenceContext); SwitchPreference autoSort = new SwitchPreference(preferenceContext); autoSort.setTitle(R.string.apps_order_pref_label); autoSort.setOnPreferenceChangeListener(this); autoSort.setChecked(sortingMode == SortingModeManager.SortingMode.RECENCY); screen.addPreference(autoSort); this.mReorderAppsPref = new Preference(preferenceContext); this.mReorderAppsPref.setKey("reorderapps"); this.mReorderAppsPref.setTitle(R.string.customize_app_order_action_title); screen.addPreference(this.mReorderAppsPref); this.mReorderGamesPref = new Preference(preferenceContext); this.mReorderGamesPref.setKey("reordergames"); this.mReorderGamesPref.setTitle(R.string.customize_game_order_action_title); screen.addPreference(this.mReorderGamesPref); updateSortingPreferenceVisibility(sortingMode); setPreferenceScreen(screen); }