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
Post a Comment