multiselectlistpreference

Android MultiSelectListPreference uncheck does not fire SharedPreferenceChanged

六月ゝ 毕业季﹏ 提交于 2019-12-22 06:50:28
问题 I'm using a MultiSelectListPreference with the following properties.. <MultiSelectListPreference android:key="shop_list" android:entries="@array/shop_titles" android:entryValues="@array/shop_values" android:title="@string/pref_title_shops" android:dialogTitle="@string/pref_title_shops" android:defaultValue="@array/shop_values" android:summary="Choose where you hunt" /> The preferences are inside a static PreferenceFragment , inside a common Activity . I m registering and unregistering the

onSharedPreferenceChanged not fired all the time

浪尽此生 提交于 2019-12-10 09:26:55
问题 I have a weird problem with this method. It's called, when i edit a EditTextPreference, only when i change the value, and on a MultiSelectListPreference only the first time i change. This is my fragment code. public class PrefFragment extends PreferenceFragment implements OnSharedPreferenceChangeListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); addPreferencesFromResource(R.xml.my_preferences); } @Override public

onSharedPreferenceChanged not fired all the time

一个人想着一个人 提交于 2019-12-05 15:45:17
I have a weird problem with this method. It's called, when i edit a EditTextPreference, only when i change the value, and on a MultiSelectListPreference only the first time i change. This is my fragment code. public class PrefFragment extends PreferenceFragment implements OnSharedPreferenceChangeListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRetainInstance(true); addPreferencesFromResource(R.xml.my_preferences); } @Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { // DO STUFF }

Android MultiSelectListPreference uncheck does not fire SharedPreferenceChanged

爱⌒轻易说出口 提交于 2019-12-05 11:28:47
I'm using a MultiSelectListPreference with the following properties.. <MultiSelectListPreference android:key="shop_list" android:entries="@array/shop_titles" android:entryValues="@array/shop_values" android:title="@string/pref_title_shops" android:dialogTitle="@string/pref_title_shops" android:defaultValue="@array/shop_values" android:summary="Choose where you hunt" /> The preferences are inside a static PreferenceFragment , inside a common Activity . I m registering and unregistering the listener for the SharedPreferenceChanged event on the onPause and onResume of the PreferenceFragment .

How can I implement a 'Select all' option for Multi Select List Preference?

时光毁灭记忆、已成空白 提交于 2019-12-05 00:13:09
问题 I want to know if there is any way to be able to select/check all boxes of the Multi-select List Preference through code. This is my XML file for the preference. <MultiSelectListPreference android:entries="@array/list" android:entryValues="@array/lValues" android:key="list" android:summary="This is a list to choose from" android:title="Teams to Follow" /> </PreferenceScreen> And these are the arrays: <string-array name="list"> <item>All Teams</item> <item>Team1</item> <item>Team2</item> <item