是否可以卸载其他应用程序使用一个Android应用程序?

是否可以卸载其他应用程序使用一个Android应用程序?

问题描述:

假设有两种不同的Andr​​oid应用程序:A和B

Suppose there are two different Android apps: A and B.

应用程序A是一个系统管理员。有什么办法为它来卸载应用程序B或使其不起作用?

App A is a system admin. Is there any way for it to uninstall app B or make it non-functional?

是的,这是可能的,你需要使用 Intent.ACTION_DELETE 看看下面code,

Yes, it is possible, you need to use Intent.ACTION_DELETE have a look at following code,

Uri packageUri = Uri.parse("package:com.mypackgage");  
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE,packageUri);  
startActivity(uninstallIntent);  

当你运行上面的code,它会要求卸载应用程序,如下所示,图像

when you run the above code, it will ask for uninstall application as follows, image