Skip to content

Commit 4a595ac

Browse files
author
shiDian
committedJul 19, 2017
修复使用浏览器下载的bug
1 parent 4b0fe3a commit 4a595ac

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed
 

‎.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/src/main/java/com/example/teprinciple/updateappdemo/updateapp/DownloadAppUtils.java

-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ public static void downloadForWebView(Context context, String url) {
3030
Uri uri = Uri.parse(url);
3131
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
3232
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
33-
intent.setDataAndType(Uri.fromFile(new File(Environment
34-
.getExternalStorageDirectory(), "tmp.apk")),
35-
"application/vnd.android.package-archive");
3633
context.startActivity(intent);
3734
}
3835

‎app/src/main/java/com/example/teprinciple/updateappdemo/updateapp/UpdateAppUtil.java

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

0 commit comments

Comments
 (0)