I've noticed a strange problem: My app uses SoundPool to play sounds. When I terminate the App with the back key while some sounds are playing, SoundPool will not work correctly the next time I start the App (even if I start another App that uses SoundPool, the sound is not working, I have to restart the device to get SoundPool working again).
I've found a solution that helps: I have to stop all playing sounds in the onDestroy() method and call then SoundPool.release().
The problem is, when the user kills the App with the task manager, onDestroy does not get called and I can not stop / release the sounds. Does anybody know
a) how I can detect that the App got killed b) use another mechanism to prevent SoundPool from not working after termination of the App
Tested on a Samsung Galaxy S Plus with Android 2.3.6