I would like to store and recall user's favorite links from string.xml how can I do this?
I would like clarify that the user only enter a name for favourite url, for example, sports it will be associated with the page that the user is currently viewing on my app (ex. www.sport.com)
my string.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">MyApp</string>
<string-array name="Name_Fav"></string-array>
//Here I would like to store the names of url favorites
//<item >Sport</item>
<string-array name="Url_Fav"></string-array>
//Here I would like to store full url
//<item >www.sport.com</item>
</resources>
in my activity
public void onClick(View v) {
String[] name_url = //Items retrieved from Name_Fav (sport)
String[] url_fav = //items retrieved from Url_FAv (www.sport.com)
//now here I would like to put and retrieve the data from the resource file
}
Edit: I found the solution here: Store a List or Set in SharedPreferences