Is it possible to programmatically uninstall a package in Android

后端 未结 4 1025
长发绾君心
长发绾君心 2020-12-01 12:16

Can a package uninstall itself? Can a package uninstall another package if they share the same userId and signature?

4条回答
  •  长情又很酷
    2020-12-01 12:22

    Hey probably too late but this works for me.

    Uri packageURI = Uri.parse("package:"+"your.packagename.here");
        Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
        startActivity(uninstallIntent);
    

提交回复
热议问题