title: Get Uri from file in either assets or res/raw
body: <p>I have tried to get this working and I have looked at many different resources online (as you can see from all of the comments I have made). I want to access a .pdf file that is either located in assets or res; It does not matter to which one so the easiest way will do.</p>
  
  <p>I have the method below that will get the actual file and will call another method(under the first method below) with the Uri in the parameters.</p>
  
  <p>Thank you very much for your help and I will be standing by to answer questions or add more content.</p>
  
  <pre><code>private void showDocument(File file)
  {
      //////////// ORIGINAL ////////////////////
      //showDocument(Uri.fromFile(file));
      //////////////////////////////////////////
  
      // try 1
      //File file = new File("file:///android_asset/RELATIVEPATH");
  
      // try 2
      //Resources resources = this.getResources();
  
      // try 4
      String PLACEHOLDER= "file:///android_asset/example.pdf";
      File f = new File(PLACEHOLDER);
  
      //File f = new File("android.resource://res/raw/slides1/example.pdf");
  
      //getResources().openRawResource(R.raw.example);
  
      // try 3
      //Resources resources = this.getResources();
      //showDocument(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + resources.getResourcePackageName(R.raw.example) + '/' + resources.getResourceTypeName(R.raw.example) + '/' + resources.getResourceEntryName(R.raw.example)));
  
      showDocument(Uri.fromFile(f));
  }
  
  protected abstract void showDocument(Uri uri);
  </code></pre>