I have some preferences within the PreferenceScreen
in the xml/preferences.xml
file. These are some items I need to show to the user. See below:
<Preference
android:key="pref_key_info"
android:title="@string/info" />
<Preference
android:key="pref_key_version"
android:summary="@string/info_version_sumary"
android:title="@string/info_version" />
When I click on the first item, in this case the <preference>
with key pref_key_info
, I want it to open a dialog with some information.
How to put an event of onClick
in <preference>
?