Skip to content Skip to sidebar Skip to footer

Using Android Mediaplayer Object For Multiple Datasources, Use Of Release();

I have several raw sound files that I want to play using the MediaPlayer class in the android API, before I change the data source to a different file do I have to call release();

Solution 1:

Call reset() first. It resets the MediaPlayer to its uninitialized state. Then you will have to initialize it again by setting the data source and calling prepare(). Call release() once you are done with the MediaPlayer instance.


Post a Comment for "Using Android Mediaplayer Object For Multiple Datasources, Use Of Release();"