安装:从sdcard

String fileName = Environment.getExternalStorageDirectory() + "/myApp.apk"; Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse("file://" + filePath),"application/vnd.android.package-archive"); 或者 //intent.setDataAndType(Uri.fromFile(new File(fileName)), "application/vnd.android.package-archive"); startActivity(intent);

卸载

Uri packageURI = Uri.parse("package:com.android.myapp"); Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI); startActivity(uninstallIntent);

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/fenghome/archive/2010/06/16/5673757.aspx

更多相关文章

  1. Android中常用的函数
  2. android 2.3.3编译 安装 Settings应用
  3. Android监听应用程序安装和卸载
  4. Android实现应用下载并自动安装apk包
  5. Mac 完全卸载 Android(安卓)Studio
  6. android 锁屏
  7. 自己祝贺一下访问量突破10000,发几个android的资料介绍(持续更新)
  8. 自己祝贺一下访问量突破10000,发几个android的资料介绍(持续更新)
  9. Android(安卓)CountDownTimer实现定时器和倒计时效果

随机推荐

  1. chrome禁用缓存:调试html5方便
  2. htmlhref属性最大支持多少个字符???(高分)
  3. 如何使flex box在safari中工作?
  4. 如何使用Java浏览和显示XML内容
  5. 关于HTML 的问题[HTML]]
  6. HTML基础学习笔记(2)
  7. 如何将带有图形链接的列表转换为内联列表
  8. 你能确定IE8的开发者工具栏中的hasLayout
  9. div底部随机5 px空间
  10. Outlook Express 无法读取Html邮件的解决