开发者

dissmissing the Progress Bar after sometime

开发者 https://www.devze.com 2023-01-28 11:58 出处:网络
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

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


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

0

精彩评论

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