0
코드 지금 진행 막대를 15 초 동안로드하는 방법은 무엇입니까?
progressBar = (ProgressBar) findViewById(R.id.progressBar);
textView = (TextView) findViewById(R.id.secdelay);
// Start long running operation in a background thread
new Thread(new Runnable() {
public void run() {
while (progressStatus < 15) {
progressStatus += 1;
// Update the progress bar and display the
//current value in the text view
handler.post(new Runnable() {
public void run() {
progressBar.setProgress(progressStatus);
textView.setText(progressStatus+"/"+progressBar.getMax());
}
});
try {
// Sleep for 200 milliseconds.
//Just to display the progress slowly
Thread.sleep(1500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}).start();
의 로딩 벌금, 나는 그것을 수행하는 방법 15ec 위해 줄을 진행 하시겠습니까? 너희들이 의미하는 바를 이해하기를 바란다. 진행 막대를로드하는 15 초와 나는 그것을 부드럽게하는 어떤 방법이라도 그 애니메이션을 뛰어 넘는 것을 보았다. 미리 감사드립니다. 멍청한 질문 죄송합니다. 그냥 학습자입니다.
의 최대 수를 사용하는자는 다른 용액 .. (progressStatus <100) ..progressStatus + = 1; 와 Thread.sleep (150); 이 상태에서 진행률 표시 줄은 15 초 안에 모두 실행됩니다. 어떻게 도와 주셔서 감사합니다. –