2014-10-09 40 views
0

我從這個代碼取回的200狀態:意外狀況

String status = cursor.getString(cursor.getColumnIndex(DownloadManager.COLUMN_STATUS)); 

200,但是,是不是已知的狀態代碼之一:

DownloadManager.STATUS_PAUSED 
DownloadManager.STATUS_PENDING 
DownloadManager.STATUS_RUNNING 
DownloadManager.STATUS_SUCCESSFUL 
DownloadManager.STATUS_FAILED 

那麼爲什麼從cursor.getString(cursor.getColumnIndex(DownloadManager.COLUMN_STATUS))返回200?

注意:在API 10相同的代碼和相同的樣本下載文件測試中,我只看到預期的狀態值,但API 14或API 17我看到200個的狀態測試。

回答

0

正確的方式來獲得地位

int status = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_STATUS));