title: Share audio file from the res/raw folder thorugh Share Intent in Android
body: <p>I'm trying to share an audio file from my res/raw folder. What I've done so far is:</p>
  
  <pre><code>Uri uri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.sound); //parse path to uri
  Intent share = new Intent(Intent.ACTION_SEND); //share intent
  share.setType("audio/*");
  share.putExtra(Intent.EXTRA_STREAM, uri);
  startActivity(Intent.createChooser(share, "Share sound to"));
  </code></pre>
  
  <p>When I choose to share it on GMail, for example, it says something like "Failed to attach empty file". Looks like I'm not getting the right file path, so I'm basically sharing nothing. What am I doing wrong? </p>
  
  <p>Any help would be much appreciated.</p>