Skip to content Skip to sidebar Skip to footer

Mediaplayer Stop Sound After 30 Click?

hi I would like to ask why is that after clicking a button w/ sound 30 times on the 31 onwards the sound will no longer be heard and will hang after a few more click? can anyone pl

Solution 1:

probably because you are allocating a new MediaPlayer instance on each click. you should call release(), to free the resources, If not released, too many MediaPlayer instances will result in an exception. you should create only 1 instance of mediaplayer and reuse it as much as possible


Post a Comment for "Mediaplayer Stop Sound After 30 Click?"