Android版本更新
来源:互联网 发布:sql增删改查面试题 编辑:程序博客网 时间:2024/06/05 06:16
以下代码可以直接使用
/** * 安装下载的apk文件 * @param context 上下文(在非Activity) * @param sdPath apk存储路径 */ public void installApk(Context context,final String sdPath) { String url=sdPath+"/Download/mengbao.apk"; final File file= new File(url); if(!file.exists()){ return; } Log.d("下载进度", "准备安装"); Intent intent= new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse("file://"+file.toString()), "application/vnd.android.package-archive"); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent); android.os.Process.killProcess(android.os.Process.myPid());//☆☆☆ 这一句如果不加,可能导致安装失败 }
阅读全文
0 0
- Android版本更新
- Android SDK版本更新
- Android软件版本更新
- Android 检测版本更新
- Android之版本更新
- Android版本更新实现
- android版本更新问题
- android apk版本更新
- android版本更新
- Android 版本的更新
- Android版本更新
- Android提示版本更新
- android 版本更新
- Android应用版本更新
- android版本更新
- Android检测版本更新
- Android中版本更新
- Android 更新升级版本
- 机器学习introduction
- virtualenv、virtualenvwrapper安装使用
- Win7提示未授予用户在此计算机上的请求登录类型
- table标签下实现内容自动换行
- Fragment里面如何使用Toast?
- Android版本更新
- -bash: fork: Cannot allocate memory 问题的处理
- ajax交互成功后数据返回到error方法中 (前端/PHP)
- 2017-11-08
- low rank读书笔记
- Convert BST to Greater Tree
- TP事物-不可缺少的操作
- MySQL存储过程和函数详细定义
- mysql数据库字符处理函数