wipand wrote: > I've to update the progress bar dynamically. i.e. while playing the > audio, i need to show the progress. But there is no listener where i > can set the progress. How to do that? As the audio plays, i want some > listener to be called on periodic basis, so that i can set the > progress.
As someone else suggested, you can use the standard Java Timer/TimerTask classes in java.util. Just start a periodic timer when playback begins and stop it when playback ends. When the timer fires, use either a Handler or UIThreadUtilities#runOnUIThread() to update the progress bar on the UI thread. If you set the progress bar's maximum to be the length of the audio clip in seconds, you can just increment the progress bar by 1 via a one-second periodic Timer, keeping the per-increment logic to a minimum. -- Mark Murphy (a Commons Guy) http://commonsware.com Android Training on the Ranch in September! http://www.bignerdranch.com --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---