【发布时间】:2014-10-29 06:42:14
【问题描述】:
在我的文件下载应用程序中,有一个 ListView,每一行都包含属性文件和一个 ProgressBar,用于下载它的状态,我使用 View Holder 模式,但进度条不更新
@Override
protected void onProgressUpdate(Long... values) {
ProgressBar bar1;
TextView status1;
DownloadStructure.setProgress(values[0].intValue());
bar1 = DownloadStructure.getProgressBarRefrence();
if (bar1 != null) {
bar1.setVisibility(View.VISIBLE);
bar1.setMax(values[2].intValue());
bar1.setProgress(DownloadStructure.getProgress());
bar1.Invalidate();
}
status1 = DownloadStructure.getProgressTextviewRefrence();
if (status1 != null) {
status1.setVisibility(View.VISIBLE);
status1.setText(DownloadStructure.getDownloadStatus());
status1.postInvalidate();
}
}
【问题讨论】:
-
我认为 'bar1' 始终为空..
-
@fatboy 我检查了它,它不为空
标签: android listview progress-bar