sharedpreferences - how can i store my player's Playlist in Android programmatically -
i building music player , want store playlist after app closed , retrieve when app started. able playlist in array list. please help.. to save when app closed override onpause method inside activity or fragment save playlist arraylist maybe in sqlite database, file or sharedpreference. retrieve write code in oncreate method can retrieve saved data. i didn't deal sqlite here sharedpreference code if wanna class playlist { private final string filename = "myplaylist"; private sharedpreferences myplaylist; private sharedpreferences.editor myeditor; playlist() { myplaylist = getsharedpreferences(filename, 0); myeditor = myplaylist.edit(); } public void save(arraylist<string> mysongs){ // save size can retrieve whole list later myeditor.putint("listsize", mysongs.size()); for(int = 0; < mysongs.size(); i++){ // save each song index in list key myeditor...