android实现自动安装
安装: String str = "/CanavaCancel.apk"; String fileName = Environment.getExternalStorageDirectory() + str; Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(new File(fileName)), "application/vnd.android.package-archive"); startActivity(intent); 卸载: Uri packageURI = Uri.parse("package:com.demo.CanavaCancel"); Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI); startActivity(uninstallIntent);
posted on 2014-04-14 09:15 strangeman 阅读(308) 评论(0) 编辑 收藏 举报