In the previous exercises of playing video using MediaPlayer, setDataSource() throws java.lang.IllegalStateException sometimes. MAY BE because the mediaPlayer still in stopping, preparing, or doing something else on last loaded video. My solution is to release the last mediaPlayer and new another mediaPlay again. It seem work fine.
Check it: Implement ActionBar for our Media Player App