What is the benefit of the stop() function compared to the pause() function in the MediaPlayer class?

StackOverflow https://stackoverflow.com/questions/9307552

  •  25-10-2019
  •  | 
  •  

Question

Both functions dont set the current Position to 0 and I have to call seekTo(0) after I called stop() in order to get the desired behavior. Moreover I need to call prepare() after I called stop().

So what is the benefit? I could easily use pause() and seekTo(0) to get the same result...

Was it helpful?

Solution

stop() clears the buffered music from memory while pause() doesn't. It's good practice to release as much memory you can. It will keep your app stable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top