开发者

How to make a function that returns after it is finished playing audio?

I want to have a method that plays a specific audio fi开发者_运维百科le and only returns when it is finished playing.


You shouldn't, it will block a thread and you'll kill CPU for nothing.

Use this: http://developer.android.com/reference/android/media/MediaPlayer.OnCompletionListener.html

Here for how to use it: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/MediaPlayerDemo_Video.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜