我正在使用下载管理器下载类型(.mov,.pdf,.png)文件。当我调用下载管理器时,下载失败并给出了作为占位符的原因。占位符是什么意思,我该如何解决这个问题?请帮忙!
我的代码如下:
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(downloadUrlFile))
.setDestinationInExternalFilesDir(context,
(Environment.DIRECTORY_DOWNLOADS), downloadFileName).setNotificationVisibility(visibility);
mEnqueue = downloadManager.enqueue(request);
mDownloadReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Log.d(TAG, "DOWNLOAD_STATUS"+intent.getAction());
String action = intent.getAction();
if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.equals(action)) {
Query query = new Query();
query.setFilterById(mEnqueue);
Cursor c = downloadManager.query(query);
if (c.moveToFirst()) {
int columnIndex = c .getColumnIndex(DownloadManager.COLUMN_STATUS);
Log.d("getColumnIndex()", "Reason: " + c
.getColumnIndex(DownloadManager.COLUMN_STATUS)+DownloadManager.STATUS_SUCCESSFUL);
if (DownloadManager.STATUS_SUCCESSFUL == c.getInt(columnIndex)) {
Log.d(TAG, "DOWNLOAD_STATUS_SUCCESSFUL");
} else if (DownloadManager.STATUS_FAILED == c.getInt(columnIndex)) {
Log.d("handleData()", "Reason: " + c.getString(c.getColumnIndex(DownloadManager.COLUMN_REASON)));
Log.d(TAG, "DOWNLOAD_STATUS_FAILED");
}
}
}
}
};