开发者

How to use Rotating Progress Bar?

开发者 https://www.devze.com 2023-01-13 10:44 出处:网络
Hi i\'m using Rotating Progress Bar in my Android Music Plyer 开发者_JS百科Application....I\'m not able to stop it. While working with horizontal Progress bar i used handler to stop and start it.

Hi i'm using Rotating Progress Bar in my Android Music Plyer 开发者_JS百科Application....I'm not able to stop it. While working with horizontal Progress bar i used handler to stop and start it. But while working with Rotating One, The progress bar goes into Infinite Loop.....

Can you please suggest method to stop the indefinite loop. Thanks in advance.


How about using ProgressBar#dismiss() method?

EDIT: dismiss() is only for ProgressDialog. For ProgressBar you should toggle the Visibilty of the View.

If mHandler is a Handler bound to your UI thread and mProgress is your ProgressBar, you can have something like the following from inside the run method of your background thread:

 mHandler.post(new Runnable() {
    public void run() {
        mProgress.setVisibility(View.INVISIBLE);
    }
 });


You can dismiss a ProgressDialog. A progressBar is just a view you can make set its visibility as visible or invisible based on your requirement


Drawable d = yourActivity.this.getResources().getDrawable(android.R.drawable.ic_dialog_alert);
d.setBounds(progressbar.getIndeterminateDrawable().getBounds());
progressbar.setIndeterminateDrawable(d);
0

精彩评论

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

关注公众号