How do I start default phone's download manager, like the one builtin in default browser? I need to create an intent that contains url of file to download. I know it's possible, as I saw some applications doing it in the past.
Asked
Active
Viewed 2,984 times
1

tshepang
- 12,111
- 21
- 91
- 136

Sebastian Nowak
- 5,607
- 8
- 67
- 107
-
I think you will see this related link usefull http://stackoverflow.com/questions/3500515/how-to-use-built-in-download-manager-on-android – A.Quiroga Oct 02 '11 at 12:00
-
and http://stackoverflow.com/q/9033224 – Alex Jasmin Aug 12 '13 at 19:12
2 Answers
0
As easy as:
startActivity(new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS));

Slion
- 2,558
- 2
- 23
- 27
-
After writing the file, if i open the downloads folder programmatically using startActivity(Intent(DownloadManager.ACTION_VIEW_DOWNLOADS)). File is not visible. But if i open from file explorer of phone, then the file is visible. Any idea, why this is happening ? – K Pradeep Kumar Reddy Jul 27 '22 at 10:48
0
What you want is DownloadManager.
Browsing the Android source code reveals that the default browser is using this as well.
EDIT
You can browse the source code for DownloadManager here and try to use the code to make it work on 7. Bare in mind the dependencies of the class might also be not available on 7 (most probably) but it might be worth a look.

Savvas Dalkitsis
- 11,476
- 16
- 65
- 104
-
Thanks, but I'm limited to API level 7 and the feature you mentioned uses API level 9. Also the applications I saw were using API below 9 too. – Sebastian Nowak Oct 02 '11 at 12:00
-
It seems it was a private API before 9. Take a look at this: http://stackoverflow.com/questions/525204/android-download-intent – Savvas Dalkitsis Oct 02 '11 at 12:00
-
you can try to replicate the DownloadManager class. Look at my edited answer – Savvas Dalkitsis Oct 02 '11 at 12:04