我正在开发一个我们不想将应用程序放在Google Play上的应用程序,因此应用程序的应用程序和更新都在我们的服务器上。
现在,当我们从服务器下载后以编程方式更新应用程序时,Android默认显示一条消息:“替换应用程序消息:您正在安装的应用程序将替换另一个应用程序。以前的所有用户数据都将被保存”。
在我们的应用程序中,我们刷新应用程序数据库,以便此特定应用程序的先前用户数据将丢失,因此在这种情况下,我想删除或更改上述消息。
请问如何更改此默认讯息?
我的重新安装代码如下:
public static boolean install(Context context, String downloadPath){
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(downloadPath+"/"+"MYAPP.apk")), "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
Log.d("INSTALLATION DONE", "***App installed");
return true;
}
答案 0 :(得分:1)
请问如何更改此默认讯息?
步骤1:从http://source.android.com
将源代码下载到Android操作系统步骤2:修改操作系统以删除此消息
步骤3:将修改后的操作系统打包到您将分发给应用程序用户的设备的修改ROM中
步骤#4:在这些设备上安装该模块ROM
IOW,您的应用不会显示此消息,而是由操作系统本身显示,并且您无法从应用中更改此行为。