0

I want to play the mediaplayer for just 10 sec. How to control it?

dev_android
  • 8,698
  • 22
  • 91
  • 148
  • http://developer.android.com/reference/android/media/MediaPlayer.html can give a list of properties that you can use to control your media player – reggie Feb 10 '11 at 14:07

2 Answers2

3

You can implement a CountDownTimer that will stop your MediaPlayer. so you will not have to implement a thread or something.

1

You could use TimerTask to schedule a MediaPlayer.stop() to run after 10 secs.

techi.services
  • 8,473
  • 4
  • 39
  • 42