我开发了一个应用程序,它在进度条中显示下载进度。
while ((chunkBytes = httpInputStream.read(outputByte, 0, 1024)) != -1) {
bytesRead = bytesRead + chunkBytes;
// write contents to the file
fileOutputStream.write(outputByte, 0, (int) chunkBytes);
// publish the progress of downloading..
publishProgress((int)((bytesRead)*100/fileSize));
}
但是,我想要做的是 - 而不是 58/100 ..(次要进度?)想在该进度下方显示 3.5 mb/5.5 mb ....(下载的 MB/总 MB)..我有试图改变次要进度但无济于事..还有其他方法吗?