1

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.

tshepang
  • 12,111
  • 21
  • 91
  • 136
Sebastian Nowak
  • 5,607
  • 8
  • 67
  • 107

2 Answers2

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