I've tryed with a Timer but it doesn't work the function inside
myTimer is called but it cannot access my progress bar :

        public void launchUpdater(){

                timer = new Timer(true);

                timer.scheduleAtFixedRate(new TimerTask(){

                        @Override
                        public void run() {
                                Log.d("logTag", "update");
                                updatePlay();
                        }

                }, VideoPlayerActivity.refreshDelay,
VideoPlayerActivity.refreshDelay);
        }

Thank you

On 23 mai, 13:58, Mark Murphy <[EMAIL PROTECTED]> wrote:
> wipand wrote:
> > I've to update theprogressbardynamically. i.e. while playing the
> > audio, i need to show theprogress. But there is no listener where i
> > can set theprogress. 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 theprogressbar
> on the UI thread.
>
> If you set theprogressbar'smaximum to be the length of the audio clip
> in seconds, you can just increment theprogressbarby 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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to