Delete my application programmatically (Android)

前端 未结 3 1744
暗喜
暗喜 2020-12-09 11:08

I want to uninstall my application on button click. For this I am using following code.

Uri packageURI = Uri.parse(\"package:\"+packageName);
Intent uninstal         


        
3条回答
  •  既然无缘
    2020-12-09 11:53

    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.

提交回复
热议问题