The official documentation about pause():
pause()
Valid states: {Started, Paused}
Invalid states: {Idle, Initialized, Prepared, Stopped,
PlaybackCompleted, Error}
"Calling this method in an invalid state transfers the object to the
Error state."
How can I be safe when doing this:
if (mediaplayer.isPlaying()) {
mediaplayer.pause()
}
The player might enter PlaybackCompleted between calling isPlaying()
and pause(), i.e. pause() is still called. This is a race condition.
(The playbackcomplete listener doesn't help anything on this.)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en