I've recently started coding an app and I've come to add preferences.
Now I need some kind of non-deprecated onClickListener.
I want to be able to clear a set of SharedPreferences using this preference which should be handled as a button. Is that possible to do in any way AND being compatible with android 2.3 and up?
XML:
<PreferenceCategory
android:title="Technisch" >
<Preference
android:key="force_update"
android:title="Force update" />
<Preference
android:key="clear_settings"
android:title="Reset antwoorden">
</Preference>
</PreferenceCategory>
I would like to do something like getPreference("clear_settings").addOnClickListener(this); but all functions i've found either don't allow code execution OR are deprecated...