Android ListPreference - Preform a method on listItem select?
I've created a ListPreference in PreferenceActivity and it works good:
- user clicks on the Preference item
- a list dialog opens (retrieves listItems and their values from arra开发者_JS百科y.xml)
- if the user selects one of the list items it saves his selection (which I can later retrieve).
My question is: how can I preform a method the second he presses one of the list items (according to the user selection)?
Appreciate any help!
You can register a OnPreferenceChangeListener
for any given preference by calling its setOnPreferenceChangeListener()
method.
精彩评论