How to use built-in download manager on Android

后端 未结 3 1025
-上瘾入骨i
-上瘾入骨i 2021-02-06 10:26

I want to develop an application for the android platform that can download some files from my server.

How can i use android\'s download manager like it is used in the A

3条回答
  •  不知归路
    2021-02-06 10:41

    You can also use the system's DownloadManager.

            DownloadManager mgr = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
    

    Posting a DownloadManager.Request to this service results in the download appearing in the notification area.

提交回复
热议问题