Delete my application programmatically (Android)

android, uninstallation

Solution

Uninstalling without user confirmation is not allowed to 3rd party applications.

As xDragonZ points out, a root process can crudely do this by literally removing the directory and leaving the package manager to deal with the loss, but that's not a very widely deployable solution, since AFAIK no devices ship with that capability for apps to run their own root helper process - that's a risky aftermarket modification.

Problem

I want to uninstall my application on button click. For this I am using following code. ``` Uri packageURI = Uri.parse("package:"+packageName); Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI); startActivity(uninstallIntent); ``` It gives me result, but I want to delete directly without click on "Ok" button of dialog with message "This application will be Uninstalled". I just want uninstalling application directly.

Original source

Related problems