ulqui wrote:
> hi
> 
> i am currently working in a media player application with a progress
> bar.
> It work well but i am searching for a listener or something that will
> make the progressbar move each second the track is playing but have
> found nothing.
> 
> i had tried
> 
>  private ProgressBar barre;
>           private int durée;
> public void onClick(View view) {
> 
>               mMediaPlayer.start();
> 
> 
>               durée=mMediaPlayer.getDuration();
> 
>              setProgress(durée);
> 
> but not working

You cannot merely call setProgress() once. If you want the ProgressBar
to update every second, you will need to call setProgress() every second.

In this sample project, I am using postDelayed() to achieve this effect:

http://github.com/commonsguy/vidtry

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
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