In your case, add the PreferenceActivity and the onCreate method:
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); getPreferences(); }
If you can inflate your presentation using the preferences.xml file - add a folder called xml to your res folder and add an xml file with materials such as:
<CheckBoxPreference android:title="@string/pref_sub_notify" android:defaultValue="true" android:summary="@string/pref_sub_notify_summary" android:key="subNotifyPref" /> <ListPreference android:title="@string/pref_sub_expiry_warn" android:summary="@string/pref_sub_expiry_summary" android:key="subExpiryDelayPref" android:defaultValue="7" android:entries="@array/sub_expiry_delay" android:entryValues="@array/sub_expiry_delay_values" />
In this case, the title is your first line, and the final is the second line.
source share