使用示例如下:
manger = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
File file = new File(openPath);
if(file.exists() == false){
file.mkdirs();
}
DownloadManager.Request down = new DownloadManager.Request(Uri.parse(info.getUrl()));
down.setShowRunningNotification(true);
down.setTitle("正在下载广东麻将更新包!");
down.setVisibleInDownloadsUi(true);
down.setDescription("更新包");
down.setDestinationInExternalFilesDir(SplashActivity.this, openPath, "gdmj.apk");
manger.enqueue(down);
manger = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
File file = new File(openPath);
if(file.exists() == false){
file.mkdirs();
}
DownloadManager.Request down = new DownloadManager.Request(Uri.parse(info.getUrl()));
down.setShowRunningNotification(true);
down.setTitle("正在下载广东麻将更新包!");
down.setVisibleInDownloadsUi(true);
down.setDescription("更新包");
down.setDestinationInExternalFilesDir(SplashActivity.this, openPath, "gdmj.apk");
manger.enqueue(down);