我有一个包含进度条的通知。进度条更新代码运行在一个service.Code低于发布更改通知进度条
notificationManager.notify(42, notification);
while((count = inputStream.read(data)) != -1)
{
//new
downloadProgress += count;
outputStream.write(data,0,count);
//new
notification.contentView.setProgressBar(R.id.status_progress, contentLength, downloadProgress, false);
notificationManager.notify(42, notification);
}
我米面对是因为notificatoinManager.notify()
方法被称为在从流读出的数据之间的问题,它减慢了复制过程。
我该如何解决这个问题?
我不认为像这样会显着减慢下载过程:P 也许你可以在新的线程更新栏(调用通知方法)... –
是啊我也没有,直到我执行代码。 –