a. 在我通过下载下载的Im中:
val downloadId: Long = downloadManager.enqueue(dr)
If user reopenning application, i m checking downloading status via:
fun isDownloadInProgress(): Boolean {
val dq: DownloadManager.Query = DownloadManager.Query()
dq.setFilterById(downloadId)
val cursor: Cursor? = downloadManager.query(dq)
if (cursor == null || !cursor.moveToFirst()) {
return false
}
val status: Int = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_STATUS))
if (status == DownloadManager.STATUS_RUNNING || status == DownloadManager.STATUS_PENDING) {
return true
}
return false
}
有了这部法典,我在小小小米的rash泥中发生了几起坠毁事件,有11和12种。
Caused by java.lang.IllegalArgumentException: column local_filename is not allowed in queries
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:172)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.query(ContentProviderProxy.java:481)
at android.content.ContentResolver.query(ContentResolver.java:1219)
at android.content.ContentResolver.query(ContentResolver.java:1151)
at android.content.ContentResolver.query(ContentResolver.java:1107)
at android.app.DownloadManager$Query.runQuery(DownloadManager.java:1506)
at android.app.DownloadManager.query(DownloadManager.java:1736)
at android.app.DownloadManager.query(DownloadManager.java:1718)
缩略语
中文不译,原文不译。
我的问题是:
- If am i using
DownloadManager
incorrect and there is another way for check download status, can someone suggest how to do this? - If is this a bug on Xiaomi ROM, can someone give me the link on issue?
感谢。