When you call SoundPool's play method you are returned a stream ID.
You can call the stop method with that stream ID to stop the sound.

SoundPool playing won't lock up your UI like that, however. That's
probably your own code. Maybe you are using Thread.sleep on the main
UI thread, for example. That thread needs to always be running to
handle calling all your app's various methods, like activity life
cycle events and on touch events. See this blog post:
http://android-developers.blogspot.com/2009/05/painless-threading.html

On Feb 24, 11:21 am, Traveler <jadkins...@gmail.com> wrote:
> I have developed an application that plays a sequence of 20 sounds
> using soundpool. If I try to use a button or touch the screen during
> the playback, I get a dialog "Sorry! Application is not responding." I
> also get a Force close button and a wait button. Is there a way to use
> the user interface to stop soundpool from playing? Any advice is
> appreciated.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to