You should never block the UI thread, otherwise you'll get the "application not responding" dialog. If you want to know when playback completes, just set an OnCompletionListener.
On Mon, May 4, 2009 at 6:17 AM, Asif k <[email protected]> wrote: > > Hi all, > > Is there anyway to block the UI Thread till the .mp3 file completes > (or in general blocking UI thread till perticular action in the b/g > thread completes). I had used following code but not got the expected > result. > > > synchronized void playFile() { > .... > mp.start(); > try { > this.wait(); > } catch(E) {} > > if(mp.isPlaying()==false) { > mp.notify(); > } > > } > > Please help. Thanks in advance. > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

