Download .apk with DownloadManager

后端 未结 1 486
野的像风
野的像风 2021-01-01 05:29

Hi I\'m facing a little problem here. For updates of my App (that isn\'t available in Play Store) I download it via DownloadManager to the Donwload directoryof

相关标签:
1条回答
  • 2021-01-01 06:16

    Yeah, well... kinda stupid..

    promptInstall.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/myApp.apk")),
    "application/vnd.android.package-archive");
    

    just affects the way android want to open the file..

    DownloadManager.Request r = new DownloadManager.Request(mUri);
                r.setMimeType("application/vnd.android.package-archive");
    

    will do it...

    0 讨论(0)
提交回复
热议问题