Skip to content

Commit

Permalink
修复使用浏览器下载的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shiDian committed Jul 19, 2017
1 parent 4b0fe3a commit 4a595ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ public static void downloadForWebView(Context context, String url) {
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setDataAndType(Uri.fromFile(new File(Environment
.getExternalStorageDirectory(), "tmp.apk")),
"application/vnd.android.package-archive");
context.startActivity(intent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public void callback() {
//服务器apk path,这里放了百度云盘的apk 作为测试
String apkPath = "http://issuecdn.baidupcs.com/issue/netdisk/apk/BaiduNetdisk_7.15.1.apk";
DownloadAppUtils.downloadForAutoInstall(context, apkPath, "demo.apk", "更新demo");
// DownloadAppUtils.downloadForWebView(context,apkPath);
}
});
dialog .setContent("发现新版本:demo2.0\n是否下载更新?");
Expand Down

0 comments on commit 4a595ac

Please sign in to comment.