title: How to open a PDF file from res/raw Folder?
body: <p>I am writing an application that opens a pdf file when you click a button. Below is my code:</p>
  
  <pre><code>File pdfFile = new File(
                          "android.resource://com.dave.pdfviewer/"
                                  + R.raw.userguide);
                  Uri path = Uri.fromFile(pdfFile);
                  Intent intent = new Intent(Intent.ACTION_VIEW);
                  intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                  intent.setDataAndType(path, "application/pdf");
  
                  startActivity(intent);
  </code></pre>
  
  <p>However when I run it and press the button it says "The document cannot be opened because its is not a valid PDF document". This is driving me mad. Am I accessing the file correctly? Any ideas? Thanks</p>