我正在使用进度条,但它没有显示持续的进度。它给出一个绿色条并且不显示连续进度(即 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();
}