2

I am doing some experiments on my device - I want to be able to remove any application from an Android device using my application.

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.

Ryan Shripat
  • 5,422
  • 6
  • 48
  • 76
Onkar
  • 43
  • 6

2 Answers2

6

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)

Community
  • 1
  • 1
Paresh Mayani
  • 125,853
  • 70
  • 238
  • 294
3

Give this a try:

Uri AppToDelete = Uri.parse("package:" + [PACKAGE NAME GOES HERE]);
Intent RemoveApp = new Intent(Intent.ACTION_DELETE, AppToDelete);
startActivity(RemoveApp);
Joe
  • 2,609
  • 20
  • 32