private void install(String filePath) {chmod("777", filePath);Intent intent = new Intent(Intent.ACTION_VIEW);intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);/* * intent.setDataAndType(Uri.parse("file://" + filePath), * "application/vnd.android.package-archive"); */intent.setDataAndType(Uri.fromFile(new File(filePath)),"application/vnd.android.package-archive");startActivity(intent);finish();}
两种方法都可以实现

更多相关文章

  1. Android 实现监听事件的几种方法
  2. Android View的构造方法
  3. Android中重写onBackPressed()方法实现双击退出
  4. Android简单实现更换桌面背景的方法
  5. android 三种解析,构建xml方法
  6. Android 文件管理方法
  7. android中自定义Toast方法详解(一)
  8. Android在网络中与JavaWeb的项目进行交互的方法

随机推荐

  1. Android(安卓)高效的SQLite型数据库green
  2. 安装包更新
  3. android studio 默认 .gitignore 文件模
  4. android水平循环滚动控件
  5. 该学什么好呢
  6. Android关于桌面快捷方式工具类!
  7. android显示gif图片
  8. Surface Flinger boot flow in Android s
  9. android获得手机cpu型号
  10. Android(安卓)Questions (问题集锦)