Mayur Kharche
Mayur Kharche

Reputation: 717

How can i get current playing song in Android programmatically

I am new to android. I am working on a music player. I can load playlist and can play a song until the app is running but how can i get my temporary playlist and current song detail when app is restarted after closing.

Upvotes: 0

Views: 1011

Answers (2)

Anirudh Sharma
Anirudh Sharma

Reputation: 7964

use Shared Preferences or sqlite to store your lists and retrieve them whenever required. You need to use any of the persistent storage to save your play list or any data and need to fetch it when your app starts again.Non persistent data gets destroyed once an app gets killed.

Upvotes: 2

Marcin Orlowski
Marcin Orlowski

Reputation: 75619

i get my temporary playlist and current song detail when app is restarted after closin

You need to save your data to make it persistent. be it in database, own flat file or shared preferences. And then reload it when app is launched again

Upvotes: 1

Related Questions