简体   繁体   中英

How to create ProgressDialog with pause and resume

I currently have url for an audio file. I'd like to create audio player like that in Evernote. Evernote音频播放器
I have tried to create a ProgressDialog where the maximum value equals the player duration. But I have no idea how to add a pause/resume Button to work with both progress bar and audio. So basically this divided into three sub-questions:

  1. How can I add a Button to ProgressDialog ?
  2. How to pause and resume the a) ProgressDialog and b) audio?
  3. How to detect that the user tabs outside of the ProgressDialog in which case the audio should be stopped?

You cannot user a pre-defined dialog for that. Create your own custom one. Here can you find everything you need to know about that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM