一段时间后关闭进度条

发布于 2024-10-05 23:42:21 字数 177 浏览 0 评论 0原文

我创建了一个进度条,我需要在单击播放特定声音的按钮时显示该进度条。现在我希望计时器显示在进度条下方,并希望进度条和计时器随着声音的长度同时运行。

另外,当声音完成时,我希望 PregressBar 和 Timer 再次不可见,以便我可以为另一个声音再次启动它。

有人可以帮我吗?

谢谢, 大卫

I have created a progress Bar which I need to show on clicking the Button that plays the particular sound. Now I want the timer to be displayed below the ProgressBar and want both the ProgressBar and Timer to run Simultaneously along with the length of the sound.

Also when the sound gets finished, I want the PregressBar and Timer to be invisible again so that I can start it again for the another Sound.

Can anybody please help me in this?

Thanks,
david

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浪漫之都 2024-10-12 23:42:21

此处使用 AsyncTask
onPreExecute 上启动计时器和 ProgressBar
doInBackground 中播放特定声音并在完成时返回
因此,在 onPostExecute 中,您可以使 PregressBar 和 Timer 停止且不可见
点击侦听器上的按钮,您可以开始执行 AsyncTask.execute

Use AsyncTask class here
start the timer and ProgressBar on onPreExecute
Play the particular sound inside doInBackground and return when it is finished
So in onPostExecute you can make that PregressBar and Timer stop and invisible
And Button on click listener you can start its execution AsyncTask.execute

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文