I have two activities, my MainActivity
and my SettingsActivity
(which instantiates the PreferenceFragment
.
I would like both activities to do:
final SharedPreferences mPrefs =
getSharedPreferences(getString(R.string.shared_prefs),
Context.MODE_PRIVATE);
mPrefs.registerOnSharedPreferenceChangeListener(mListener);
Where each has its own implementation of mListener
(a SharedPreferences.OnSharedPreferenceChangeListener
) .
What I am seeing is that only one of the of the OnSharedPreferenceChangeListener
is triggered.
Any ideas?
Yes, it is possible to have multiple listeners at once as seen here:
It is likely your problem is elsewhere.