开发者

Android ListPreference - Preform a method on listItem select?

开发者 https://www.devze.com 2023-01-20 03:25 出处:网络
I\'ve created a ListPreference in PreferenceActivity and it works good: user clicks on the Preference item

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消