Android MediaPlayer Error (1,-22)

橙三吉。 提交于 2019-12-10 17:29:56

问题


Error (1,-22) occurs after long playing (about hour or more) the same track in a loop. I can't figure out the reason of that error. Everything is okay if track is playing for short time. But if I keep track playing for long time in my Service, sometimes the error happens.

I know that 1 is MEDIA_ERROR_UNKNOWN, but cant find anything about -22.

Any suggestions? API 24


回答1:


It seems to issue appears because I didn't call MediaPlayer.release() when onCompletion callback. As a result resources of MP did not released and finally MP crashed with the error.



来源:https://stackoverflow.com/questions/42416692/android-mediaplayer-error-1-22

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!