title: How to use default Package Installer (Android) when trying to install an APK from another app?
body: <p>I have been trying to install other apps from my app. I have downloaded the .apk from the server and I am firing an intent with the following content</p>
  
  <pre><code>Intent installIntent = new Intent(Intent.ACTION_INSTALL_PACKAGE);
  
  installIntent.setData(Uri.parse("file:&lt;apk file location&gt;"));
  installIntent.putExtra(Intent.EXTRA_INSTALLER_PACKAGE_NAME, DOWNLOADED_PACKAGE_NAME);
  installIntent.putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, true);
  installIntent.putExtra(Intent.EXTRA_RETURN_RESULT, true);
  
  startActivityForResult(installIntent, REQUEST_INSTALL); 
  </code></pre>
  
  <ul>
  <li>But I am stuck with setting the default installer while trying to install a package. </li>
  <li>Following prompt is shown once my install intent is fired ask user to choose a default application to handle the intent which is not desired.</li>
  <li>This prompt shouldn't be shown to the user. </li>
  <li>The desired behavior is to start installing the package once download is complete like Google Play does. </li>
  <li>Install Button clicked --> Download --> Ask Permission --> Install.</li>
  </ul>
  
  <p>How to avoid this prompt?</p>
  
  <p>This feature has been added since 4.2 ONLY.</p>
  
  <p><img src="https://i.stack.imgur.com/KWTRZ.png" alt="enter image description here"></p>