借助这篇文章“Android:以编程方式安装 .apk”。我已在我的 Android 2.3 设备上成功进行了自动升级/自动安装:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "app.apk")), "application/vnd.android.package-archive");
startActivity(intent);
但它在 Android 4.0(ICS) 设备上失败并给了我错误消息:
an existing package by the same name with a conflicting signature is already installed
有什么问题?
谢谢!