你的位置:首页 > 软件开发 > Java > android 6.0 Intent 安装apk闪退

android 6.0 Intent 安装apk闪退

发布时间:2016-06-02 04:00:04
需求描述:利用android系统自带的DownloadManager下载apk文件,并且打开安装界面。问题描述:关于DownloadManager的使用网上有很多例子,在此不啰嗦。下载完成之后在android6.0(api=23)环境下打开安装界面出现闪退(确认已经在Androi ...

需求描述:

利用android系统自带的DownloadManager下载apk文件,并且打开安装界面。
问题描述:
关于DownloadManager的使用网上有很多例子,在此不啰嗦。下载完成之后在android6.0(api=23)环境下打开安装界面出现闪退(确认已经在AndroidManifest.
public static void install(Context context, String filePath) {  Intent i = new Intent(Intent.ACTION_VIEW);  i.setDataAndType(Uri.parse("file://" + filePath), "application/vnd.android.package-archive");  i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  context.startActivity(i);}

原标题:android 6.0 Intent 安装apk闪退

关键词:Android

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录