Android: MediaPlayer AUDIOFOCUS_LOSS & setOnErrorListener() issue

后端 未结 2 415
隐瞒了意图╮
隐瞒了意图╮ 2021-01-14 11:27

I\'m creating a music player app.

In that I am checking if my application loses AudioFocus then the playback will stop. But this is raising one issue that when I pla

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-14 12:20

    Unfortunately IllegalStateExceptions don't trigger the OnErrorListener call. You will have to try/catch around portions of your code for IllegalStateExceptions where they may be triggered.

提交回复
热议问题