我的Progress进度条实例总是无法实现动态改变进度条进度,求实例。

解决方案 »

  1.   

    你找一个JqueryUI的插件看看啊不过我不知道你是BS架构还是CS架构的。
      

  2.   

    public class ProgressBarStu extends Activity {private ProgressBar progressBar = null;
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.progressbar);
    //从这到下是关键
    progressBar = (ProgressBar)findViewById(R.id.progressBar);Thread thread = new Thread(new Runnable() {@Override
    public void run() {
    int progressBarMax = progressBar.getMax();
    try {
    while(progressBarMax!=progressBar.getProgress())
    {int stepProgress = progressBarMax/10;
    int currentprogress = progressBar.getProgress();
    progressBar.setProgress(currentprogress+stepProgress);
    Thread.sleep(1000);
    }} catch (InterruptedException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }}
    });thread.start();//关键结束
    }}