android - How to keep MediaPlayer going no matter what -


so i've been working on music player android , i've run problem i'm having trouble fixing. when user starts song, store playing song in public variable in "player" class. used determine song play next, among other things.

the problem app crashes when user opens lot of other memory intensive apps. mediaplayer stops playing, , reference playing song lost. i'm pretty sure happens because these other apps claim memory app using.

my question is: how can make sure mediaplayer keeps on playing? standard android music player doesn't seem have problem should possible keep playing @ times somehow.

the best can host mediaplayer in foreground service.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -