title: How to open a local app file in another app via an intent?
body: <p>To preface my question, couple things to note.  I don't want to store said file on the sdcard in this case.  The file also cannot be storage directly in the apps local files directory.  It needs to be in a subdirectory, so it cannot write the file using openFileOutput() and MODE_WORLD_READABLE.</p>
  
  <p>The app may download files small files like pdfs and store them locally in a subdirectory. I would like to be able to have the user open these files if they have an app that can open them.</p>
  
  <p>For example here is an intent for sending a pdf:</p>
  
  <pre><code>Intent intent = new Intent(Intent.ACTION_VIEW);
  intent.setDataAndType(Uri.fromFile(path), "application/pdf");
  startActivity(intent);
  </code></pre>
  
  <p>path being something like:  /data/data/packagename/files/subdir/example.pdf</p>
  
  <p>That intent will open a pdf viewer, but the viewer is unable to open the file.  I assume this is a permissions issue.  I tried Mark Murphy's suggestion here: <a href="http://groups.google.com/group/android-developers/browse_thread/thread/4e55d869213483a9/b7270078ac1a2744?lnk=raot" rel="nofollow">http://groups.google.com/group/android-developers/browse_thread/thread/4e55d869213483a9/b7270078ac1a2744?lnk=raot</a> of using <code>Runtime.getRuntime().exec("chmod 755 " + fileName);</code> but it didn't make any difference.  He also suggested a Content Provider but I would like to avoid it if I can because it seems like a lot just to get this file over to another app.</p>
  
  <p>If the content provider is the only option, do I have to save the file to the content provider or can I just use the content provider as a pass through to get it to the other app when I need to?</p>
  
  <p>Thanks, let me know if I'm not being clear.</p>