/** *启动安装APK * @author YOLANDA * @param path * @return */    public static void installApkByPath(Context context, String path){        Intent intent = new Intent(Intent.ACTION_VIEW);        intent.setDataAndType(Uri.fromFile(new File(path)), Constants.INSTALL_MIMETYPE);        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);        context.startActivity(intent);    }    /** * 启动卸载 * @author YOLANDA * @param context * @param oldpackage */    public static void uninstallApkByPackage(Context context, String oldpackage){        try {            Uri packageURI = Uri.parse("package:" + oldpackage);            Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);            context.startActivity(uninstallIntent);        } catch (Exception e) {        }    }

更多相关文章

  1. Activity的启动流程
  2. Android(安卓)Studio安装app 报错的问题It is possible that thi
  3. 获取安装的应用
  4. android获取手机已经安装的app信息
  5. 指定浏览器访问指定页面(支持UC、Opera、QQ、Dolphin、Skyfire、
  6. 迈向Android的第一步 - 搭建Android开发环境
  7. android app 开启自动启动
  8. Android(安卓)静默安装
  9. Android(安卓)JNI环境搭建及开发入门

随机推荐

  1. Android--应用开发3(Android(安卓)layout
  2. Android(安卓)属性文件build.prop,获取属
  3. Android布局属性解析
  4. android键盘弹出之后界面整体上移,顶出去
  5. LinearLayout中gravity和layout_gravity
  6. 搭建Android(安卓)+ Eclipse环境时遇到的
  7. 系出名门Android(9) - 数据库支持(SQLite
  8. Android之 UI主线程
  9. Android(安卓)网络编程
  10. RotateAniamtion_实现Android简单动画旋