How to create a package URI using PackageManager in android

I need to create a PackageUri to delete a package using action.delete. I got the PackageInfo object using PackageManager. Is there a way to build a PackageUri using PackageInfo?

thank.

+3


source to share


1 answer


I got it, say we have PackageInfo pinfo

String pkg= "package:"+ pinfo.packageName;
Uri pkg_uri= Uri.parse(pkg);

      



We now have a uri package to remove

Intent intent = new Intent(Intent.ACTION_DELETE, pkg_uri);
startActivity(intent);

      

+2


source







All Articles