title: How to detect the situation when a user cancels a program (".apk") installation?
body: <p>How to detect the situation when a user cancels an application (.apk file) installation?  </p>
  
  <p>My app programmatically installs other apps, but users can cancel installation process. During the installation a user sees a dialog like that: <em>"Replace application. The application you are installing will replace another application"</em>. And then a dialog <em>"Do you want to install this application?"</em>. If the user presses "Install" the <code>ACTION_PACKAGE_...</code> broadcast is generated. But how to detect if the user presses "Cancel"?</p>