Android 安装apk过程中奔溃
来源:互联网 发布:java stringbuffer数组 编辑:程序博客网 时间:2024/06/15 23:48
最近在写一个自动升级代码的时候, 下载了apk后安装,在网上找了个代码:
Intent intent = new Intent();intent.setAction(Intent.ACTION_VIEW);//执行动作intent.setDataAndType(Uri.fromFile(localFile), "application/vnd.android.package-archive");mContext.startActivity(intent);
结果在安装快要完成的时候,整个安装过程奔溃了,经过一系列分析测试原来是少了一行代码:
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
所以正常应该是这样:
Intent intent = new Intent();intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);intent.setAction(Intent.ACTION_VIEW);//执行动作intent.setDataAndType(Uri.fromFile(localFile), "application/vnd.android.package-archive");mContext.startActivity(intent);
0 0
- Android 安装apk过程中奔溃
- Android apk安装过程
- Android APK安装过程
- Android APK安装过程
- Android APK安装过程
- Android APK安装过程
- android apk 安装过程
- Android apk 的安装过程
- Android apk 的安装过程
- Android apk安装过程 目录
- Android-07-apk安装过程
- Android中APK安装过程
- Android apk安装过程,笔记。
- Android apk 的安装过程
- Android APK的安装过程
- Android Apk安装过程分析
- Android 安装、卸载APK过程底层分析
- Android备份:APK安装过程及原理
- #error的作用
- java 遍历arrayList的四种方法
- mysql查重处理问题
- 欢迎使用CSDN-markdown编辑器
- 【Android】application标签说明
- Android 安装apk过程中奔溃
- BZOJ 1103
- flask笔记:9:蓝图
- host ... is not allowed to connect to this MySql server
- 线程池Thradpoolexecutor的构造介绍
- [LeetCode] 187. Repeated DNA Sequences
- HDU 5895 Mathematician QSC (矩阵快速幂 + 逆元应用 + 指数循环节 + 欧拉函数)
- Excel——if函数常用总结
- HTTP 状态响应码 意思详解/大全-续