知乎专栏 |
DownloadManager manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE); Uri uri = Uri.parse("https://www.netkiller.cn/linux/images/cover.png"); DownloadManager.Request request = new DownloadManager.Request(uri); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE); long reference = manager.enqueue(request);