开发者

Restoring Android Activity playing media

开发者 https://www.devze.com 2023-02-28 05:06 出处:网络
I\'m working on a project that includes a media player. All is going fine, I select the media to be played from a play list and send it to the player activity and press play. The audio plays just like

I'm working on a project that includes a media player. All is going fine, I select the media to be played from a play list and send it to the player activity and press play. The audio plays just like it should. Now, when I leave that activity (with the audio still playing) I'm unable to get back to that same activity, clicking the same item from the playlist starts a new activity with 开发者_如何学Gothe old media playing in the background still. How can bring back an old activity?


I don't get your question at all. However, look at the state diagram here:

http://developer.android.com/reference/android/media/MediaPlayer.html

And the other state diagram here:

http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle

Combine the MediaPlayer states and the Activity states in order to fulfill your need.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号