title: Opening document located in application directory by another activity
body: <p>I have the following code which tries to open file with default reader:</p>
  
  <pre><code>Intent intent = new Intent();
  intent.setAction(android.content.Intent.ACTION_VIEW);
  intent.addFlag(Intent.FLAG_GRANT_READ_URI_PERMISSION);
  // type can be "application/msword" or "application/pdf"
  intent.setDataAndType(Uri.fromFile(file), type);
  activity.startActivity(intent);
  </code></pre>
  
  <p>File is located on Android device within the application folder:</p>
  
  <pre><code>/data/data/air.com.foo.foo/com.foo.foo/Local Store/folder1/file.ppt
  </code></pre>
  
  <p>The problem is that launched activity fails to find the file. I checked for file presence in caller code so it is not the problem.</p>
  
  <p>Furthermore, activity finds the file if I copy it from application folder to a folder shared by applications (on sdcard).</p>
  
  <p>I don't understand why it fails since I have added:</p>
  
  <pre><code>intent.addFlag(Intent.FLAG_GRANT_READ_URI_PERMISSION);
  </code></pre>
  
  <p>The problem is that copying file to a shared folder for me is not a satisfactory solution as I would like it to stay within my initial application folder.</p>