I am using the Android MediaPlayer to play a Video in my app.
MediaPlayer.prepare() instead of
MediaPlayer.prepareAsync() deliberately, because I want to be able to know when the statement is finished so that I can, for example, hide a progress bar.
I realize that I could do this with a
MediaPlayer.prepareAsync(), but since this would create an ugly overhead in my code, would only be used for this detection and probably wouldn’t help in this situation anyway, I don’t want to do that.
When I start my activity with the video loading and I try to go back to the previous activity before it finished
MediaPlayer.prepare(), it throws an
All the steps I take before that are synchronized, so just catching the Exception and ignoring it would be possible here, however, I don’t want to have throwing and catching an Exception as expected behavior if I can avoid it.
I’ve already tried to call
MediaPlayer.prepare() is running, but the same thing happens.
For more info please click herehttps://stackoverflow.com/q/55157082