سؤال

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 array.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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top