How To Save "now Playing" List Of Music Player App In Android?
I'm going to create a simple Musicplayer for Android using Service. But I don't know the best way to save list of nowplaying. I used a database to store the list, but in this way,
Solution 1:
You could use a Object Array List to store the music player list and you need to pass it trough activities using the intent PUT method.
here is an example
intent.putStringArrayListExtra("data", data)
Here is a skeleton of the code you need:
// Create the list private List test;
test = new ArrayList(); //Add some items to the list.
// Call the PUT method Intent intent = getIntent(); intent.putStringArrayListExtra("test", (ArrayList) test);
And the you will retrieve like the code below.
ArrayList test = data.getStringArrayListExtra("test");
Hope that helps.
Post a Comment for "How To Save "now Playing" List Of Music Player App In Android?"