title: Android install .apk file programmatically
body: <p>I'm trying to do an autoupdate function, after a lot of search I've found solution for download .apk file from my server to my device
  But i'can't launch this file, window to prompt user for install open but close direct.</p>
  
  <p>this is my code</p>
  
  <pre><code>Java.IO.File file = new Java.IO.File(destination);
  
  Android.Net.Uri apkURI = Android.Support.V4.Content.FileProvider.GetUriForFile(
                                    _context,
                                    _context.ApplicationContext.PackageName + ".provider", file);
  
   Intent promptInstall = new Intent(Intent.ActionView);
   //promptInstall.SetDataAndType(apkURI, "application/vnd.android.package-archive");
   promptInstall.SetData(apkURI);
  
   promptInstall.AddFlags(ActivityFlags.NewTask);
   promptInstall.AddFlags(ActivityFlags.GrantReadUriPermission);
           _context.GrantUriPermission(_context.ApplicationContext.PackageName, apkURI, ActivityFlags.GrantReadUriPermission);
  _context.StartActivity(promptInstall);
  </code></pre>
  
  <p>I've tryed with a lot of combinaison of flags and Ident.Action like ActionInstallPackage</p>
  
  <p>android version is 8.1</p>
  
  <p>thanks</p>