title: How can I open a PDF file using Intent in Android Nougat?
body: <p>I appreciate your help so that my code can open a PDF file with an Intent, this is the code i have been using:</p>
  
  <pre><code>String pathFile =
      Environment.getExternalStorageDirectory().toString() +
      FileUtils.PATH_SEPARATOR + "myFolder" +
      FileUtils.PATH_SEPARATOR + "myFile.pdf";
  File pdfFile = new File( pathFile );
  if ( pdfFile.exists() ) {
      Uri uri = Uri.fromFile( new File( pathFile ) );
      Intent intent = new Intent( Intent.ACTION_VIEW );
      intent.setDataAndType(uri, "application/pdf");
      intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
      startActivity( intent );
  }
  </code></pre>
  
  <p>But I understand that now (from the Android-N version) the privileges are handled differently and so i hope you can help me by indicating what changes i have to make to get a PDF file opened using an Intent.</p>
  
  <p>PS: In my AndroidManifest.xml I am looking for all permissions in the STORAGE:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  </code></pre>