I'm trying to make an uninstaller app and this is the part that I use to uninstall an app:
Uri uri = Uri.fromParts("package", app.getPackageName(), null);
Intent intent = new Intent(Intent.ACTION_DELETE, uri);
startActivity(intent);
When the user clicks the uninstall button, a confirmation popup dialog appear. Is there a way to check if the user has clicked OK or CANCEL in the dialog box ?