我正在尝试使用DownloadManager.Request保存我的文件。我使用request.setDestinationInExternalPublicDir()但该文件仍保存在内部存储上。如何强制将其直接保存在外部存储设备上?我的外部存储空间完全可用,并且在Manifest中授予了权限。
这是我的下载代码。
request.setAllowedOverRoaming(false);
request.setTitle(track.getTitle());
request.setDestinationInExternalPublicDir("trackType", track.get_id());
request.addRequestHeader("Authorization", Utils.getToken(currentActivity));
request.addRequestHeader("Client", "androidMobileApp");
request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI | DownloadManager.Request.NETWORK_MOBILE);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN);
startDownloadNotification(track);
downloadReference = downloadManager.enqueue(request);