java.lang.IllegalStateException what does it mean?

后端 未结 2 1262
走了就别回头了
走了就别回头了 2020-12-12 21:42

I\'m developing a video application. After 1st video playback done, in the \"OnCopletion\" I\'m trying to start a new one. But it just stops (not crashes) and do nothing. In

相关标签:
2条回答
  • 2020-12-12 22:09

    If you see this state diagram (taken from https://developer.android.com/reference/android/media/MediaPlayer.html#StateDiagram): enter image description here

    You will realize that you should call reset() to get it back to the idle state. Only then can you call setDataSource()

    0 讨论(0)
  • 2020-12-12 22:15

    Android docs say about IllegalStateException:

    Thrown when an action is attempted at a time when the VM is not in the correct state.

    0 讨论(0)
提交回复
热议问题