1
我正在使用進度條,但未顯示持續進度。它給出了一個綠色的橫條,並沒有顯示持續的進展(即10次進展)。進度條未顯示進度條
private ProgressBar mProgress;
private int mProgressStatus = 0;
private Handler mHandler = new Handler();
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.fetchee_distance);
mProgress = (ProgressBar) findViewById(R.id.p);
Thread timer = new Thread() {
public void run() {
try {
sleep(1000);
while (mProgressStatus < 100) {
mProgress.setProgress(mProgressStatus);
// mProgress.setMax(100);
mProgressStatus += 10;
System.out.println("count" + mProgressStatus);
}
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
/*
* Intent openMainList = new Intent(StartPoint.this,
* in.isuru.caf.MainList.class);
* startActivity(openMainList);
*/
}
}
};
timer.start();
}
我想你的睡眠應該在你的循環中 – njzk2 2013-03-15 16:40:42