I have no problem to save list in sharedpreferences and show it in list view but my problem is when i restart the app and try to add items to listview old stored items removed . there is my code:
public void SaveDatesToList(){
list.add(i+"");
array = new String[list.size()];
list.toArray(array);
tinyDB.putListString("DATES",list);
}
public void getDates(){
for (String str:tinyDB.getListString("DATES")) {
list.add(str);
}
Please Try this two function store arrlist and retrive arraylist in sharedprefrence