Reputation: 548
I want to play music in my app, that i can do. But the problem is how can i continue playing music even if the app is not in foreground. The musiv should stop only when the user select stop button, or pauses it.
Thanks,
Any help will be most appreciated.
Upvotes: 0
Views: 4241
Reputation: 2340
as the others said you could use Service
Or you could just make the song play in background thread, and make user back-key to back to their home screen via moveTaskToBack(true);
Upvotes: 0
Reputation: 3466
Try using a Service. That link gives a tutorial on how to use a background process. Hope this helps.
Upvotes: 0