pref.setTitle(title); pref.setSummary(summary); if (intent != null)
private void addNewPref(String title) { Preference newPref = new Preference(this); newPref.setTitle(title); ((PreferenceScreen) getPreferenceManager().findPreference("category_key")).addItemFromInflater(newPref); }
LinearLayout layout = new LinearLayout(this); layout.setBackgroundResource(R.drawable.background1); layout.setId(567890); PreferenceScreen preference; preference = getPreferenceScreen(); Preference new_preference = new Preference(this); new_preference.setKey("key1"); new_preference.setTitle(""); new_preference.setLayoutResource(567890); preference.addPreference(new_preference);
pref.setTitle(title); pref.setSummary(summary);