I am writing a PreferenceActivity for my Android app. I have question about ListPreference.
How can I make aListPreference that does an action if the 1st, 2nd, or 3rd string is selected? The XML looks like this:
<ListPreference
android:defaultValue="1000"
android:dependency="perform_updates"
android:entries="@array/Select_Shoe_Country"
android:key="updates_interval"
android:summary="Select Shoe"
android:title="Example1" /> `
First of all, you need an
android:entryValuesarray so that the system knows what each of the user's options means. Now, to directly answer your question, it may be easiest to launch anIntentbased on theandroid:entryValuesthat is selected. Of course, it really depends on what exactly you want it to do.