我有一些列表首选项,但我不知道如何保存列表中的各个值。我该怎么做?这是我所拥有的
http://i41.tinypic.com/dh4gvo.png
Preference customPref = (Preference) findPreference("notificationPref");
customPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
SharedPreferences customSharedPreference = getSharedPreferences(
"notifications", Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = customSharedPreference
.edit();
editor.putString("notification",
"The preference has been clicked");
editor.commit();
return true;
}
});
我的列表单击侦听器仅适用于列表首选项页面中的主要项目,而不适用于弹出窗口本身中的项目。如何保存在弹出窗口中选择的选项?