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中重写onBackPressed()方法实现双击退出
  2. Android(安卓)四大组件--service的使用与生命周期
  3. android屏幕保持唤醒
  4. Android(安卓)View的构造方法
  5. ClassNotFoundException 案例
  6. Android(安卓)实现监听事件的几种方法
  7. Android(安卓)中的 requestWindowFeature
  8. 浅谈Java中Collections.sort对List排序的两种方法
  9. Python list sort方法的具体使用

随机推荐

  1. [置顶] Android(安卓)百度地图 简单实现-
  2. CheckedTextView 显示问题
  3. [Android(安卓)Memory] Android(安卓)的
  4. 监听Android应用程序是否卸载成功
  5. android圆角矩形的实现
  6. virtualbox 安装android设置分辨率(自定
  7. 【Android】Android(安卓)Studio百问
  8. [Android] 环境配置之Android(安卓)Studi
  9. Android(安卓)framework系统手势
  10. android:TextAppearance.Material.Widget