Uri uri = Uri.fromParts("package", <Your Package name here>, null);
Intent deleteIntent = new Intent(Intent.ACTION_DELETE, uri);
startActivity(deleteIntent);
Explanation
We build the proper package name using Uri.fromParts function, this will results in something like package://xxx
Uri uri = Uri.fromParts("package", <Your Package name here>, null);
We then create a new intent that have the delete action with our package uri
Intent deleteIntent = new Intent(Intent.ACTION_DELETE, uri);
Finally we start the deleteIntent that would show us the uninstall application dialog box
startActivity(deleteIntent);
Hope this helps
Update History
Jan 17, 2012 - Visual Update
1 comment:
[...] we blogged about how to delete application by their package name. Now here is how to open applications using code, note this is not the same as [...]
Post a Comment