我使用以下代码尝试检查下载进度是什么,它总是返回0.有谁知道这是为什么?我不能让它成为0以外的任何东西。
DownloadManager.Query query = new DownloadManager.Query();
query.SetFilterById(downloadID);
Android.Database.ICursor cursor = downloadManager.InvokeQuery(query);
cursor.MoveToFirst();
for (int i = 0; i < 10; i++)
{
System.Threading.Thread.Sleep(50);
string s = cursor.GetString(cursor.GetColumnIndex(DownloadManager.ColumnBytesDownloadedSoFar));
Log.Debug("Total Bytes", s + " = string at position " + cursor.GetColumnIndex(DownloadManager.ColumnBytesDownloadedSoFar));
}