[英]How do I remove any app from a device using my app in android?
I am doing some experiments on my device - I want to be able to remove any application from an Android device using my application. 我正在我的设备上做一些实验 - 我希望能够使用我的应用程序从Android设备中删除任何应用程序。
Given the package name of an app, how can I force the user to go to that package's uninstaller page in the Manage Applications widget? 给定应用程序的程序包名称,如何强制用户转到“管理应用程序”窗口小部件中的该程序包的卸载程序页面?
Thanks. 谢谢。
This may be helpful to you: 这可能对您有所帮助:
Uri packageURI = Uri.parse("package:com.android.myapp");
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
startActivity(uninstallIntent);
For more and detailed information regarding the installation and uninstallation, read this question: install / uninstall APKs programmatically (PackageManager vs Intents) 有关安装和卸载的更多详细信息,请阅读以下问题:以编程方式安装/卸载APK(PackageManager vs Intents)
Give this a try: 尝试一下:
Uri AppToDelete = Uri.parse("package:" + [PACKAGE NAME GOES HERE]);
Intent RemoveApp = new Intent(Intent.ACTION_DELETE, AppToDelete);
startActivity(RemoveApp);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.