I am displaying my “Settings” screen through a class that extends PreferenceFragment. I need to know when a particular setting is clicked so that I can handle the Intent to launch at runtime, as opposed to declaring in xml like this:
<PreferenceScreen
android:title="@string/terms_conditions"
android:summary=""
android:layout="@layout/settings_item">
<intent android:action="android.intent.action.VIEW"
android:data="http://www.somecompany.com/m/EULA.aspx" />
</PreferenceScreen>
I need to fire a different Intent depending on other variables involved.
So, what I need is to know when the user clicks the “Terms and Conditions” within the settings fragment.
Have the class in which you need to know about config changes implement
and install it as a listener in your SharedPreferences via
Then handle the changes is
The relevant documentation is about SharedPreferences and SharedPreferences.OnSharedPreferenceChangeListener