forum

Home / DeveloperSection / Forums / How to slow down progressbar progression?

How to slow down progressbar progression?

Anonymous User 2661 16-Nov-2014

I am using this code here to loop and update progress on a custom progressbar.

class MyThreadRunner implements Runnable {
        // @Override
     int count = 0;
        public void run() {
            try {
            while (count < 90) {
                Thread.sleep(10);
                count += 1;
                 progressBar.setProgress(count);
                 progressBar.setText(count + "%");
            }
                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                }
 };

When it gets closer towards the end I want it to start slowing down,is this possible without have to make another while loop?


Updated on 17-Nov-2014
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By