Let's say I have 10 buttons whose ID's are 1,2,...,10. I have an XML file called preferences.xml that contains a checkbox:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="applicationPreference" android:title="@string/config">
<CheckBoxPreference
android:key="checkbox" />
</PreferenceScreen>
My buttons all call the same function which calls for the intent to start the PreferenceActivity.
What I want to do is to call the same model with every button but save the values of the checkbox for each button. Currently, every time I click on a button, it launches the activity, but, for example, the value of my button 1 will be found in the value of my button 5.
Should I use SharedPreferences or something else?
I know it's possible but as I am still unfamiliar with many concepts, I just don't find it.