Android的下载管理器 [英] Android Download Manager
本文介绍了Android的下载管理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想我有一个非常简单的问题。
I think i have a rather simple question.
http://www.vogella.com/blog / 2011/06/14 / Android的下载管理器,例如/
我已经按照上述网址的教程。
I have been following a tutorial in the above url.
如何更改文件路径为下载?
How do I change the filepath for downloads?
在此先感谢
推荐答案
您配置<一href="http://developer.android.com/reference/android/app/DownloadManager.Request.html">DownloadManager.Request对象之类的信息。在本教程中,即要求
对象被创建和使用的onClick()
。
You configure the DownloadManager.Request object with that sort of information. In the tutorial, that Request
object is created and used in onClick()
.
例如:
DownloadManager.Request req=new DownloadManager.Request(uri);
req.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI
| DownloadManager.Request.NETWORK_MOBILE)
.setAllowedOverRoaming(false)
.setTitle("Demo")
.setDescription("Something useful. No, really.")
.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,
"test.mp4");
(以上code是此示例项目)
这篇关于Android的下载管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文