简体   繁体   English

如何在Android中使用我的应用程序从设备中删除任何应用程序?

[英]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.

相关问题 如何链接到设备上的Android应用程序? - How do I link to my Android app on device? 如何在设备上运行Android应用程序? - How do I run an Android app on my device? android:如何从我的应用程序打开另一个应用程序? - android: how do i open another app from my app? 如何将Android应用程序保护到设备? - How do I secure an Android app to a device? 如何从我的 android 应用程序中删除 QUERY_ALL_PACKAGES 权限? - How do I remove the QUERY_ALL_PACKAGES permission from my android app? Android:以编程方式从设备管理员中删除我的应用程序? - Android: Programmatically remove my app from Device Administrator? 如何从我的应用程序中删除标题栏? - How do I remove the title bar from my app? 我希望设备中来自任何来源的每个 http url 请求都通过我的 android 应用程序 - I want every http url request in the device from any source to pass through my android app 如何从我的网络浏览器 (Chrome) 在 Android 中打开任何应用程序? 我与 A Href 链接有什么关系? - How do I open any app from my web browser (Chrome) in Android? What do I have to do with the A Href link? 如何从应用程序的操作栏中删除/隐藏活动的名称。 我正在使用Android Studio - How to remove/hide the name of activity from the action bar of my app. I am using Android Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM