假设您有一个Web服务器来为您的“最新应用程序”提供服务,您可以要求您的开发人员进行简单的版本检查,下载更新apk,然后按照以下步骤启动安装:
Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(new File(PATH, "update.apk")), "application/vnd.android.package-archive"); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // without this flag // android returned // a intent error! context.startActivity(intent);