Here’s my problem: I start a media player, and if I start a new intent, or leave the app and go back to it..
mp.stop;
..wont work (mp is my media player variable).
is there anyway to fix this?
Bonus to whoever can tell me how to link it up to a widget.
You always must call
mp.release()in your Activity’sonDestroy(). It is also recommended to at least callmp.pause()in ononPause()Activity’s method.If you want playback to continue outside of Activity lifecycle (after
onPause()/onStop()/onDestroy()) you have to create Service and play audio content from there.