title: Auto insall the application without asking from user
body: <p>I have an android application in which i am downloading the apk from web server and store it in local storage after storing in externel storage. I open the apk file programmatically and then I install the apk programmatically. This is my code for installing the app programmatically.</p>
  
  <pre><code>    Intent intent = new Intent(Intent.ACTION_VIEW);
  
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.N) {
          intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
          Uri contentUri = FileProvider.getUriForFile(MainActivity.this, "com.ariaware.store.fileProvider", file_path); // Here filepath is location of apk file in local storage
          intent.setDataAndType(contentUri, "application/vnd.android.package-archive");
  
      } else {
          intent.setDataAndType(Uri.fromFile(file_path), "application/vnd.android.package-archive");
      }
      startActivityForResult(intent, INSTALL);
  </code></pre>
  
  <p>This code takes me to this <a href="https://i.stack.imgur.com/9lUgy.jpg" rel="nofollow noreferrer">Screen. Please have a look here</a>. There are two options install and cancel on this screen. Now user needs to click on install in order to install the app. What I want user don't need to click on install. App should automatically install the app without asking from user.
  Any kind of help will be grateful
  I need your help guys i want to learn how can i install the apps in background</p>