Sending GMail with attachment from Android app
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5762073/problem-attaching-internal-file-to-gmail-in-my-android-app">Problem Attaching internal file to GMail in my android app</a>  </p>
</blockquote>



<p>My app writes data to text files on internal memory.<br>
Later the app emails the text files to a list of people.   </p>

<p>If the user selects GMail to send the mail and attachment, the mail goes, but attachment does not.  </p>

<p>I get the following message in logcat:  </p>

<blockquote>
  <p>ERROR/Gmail(9147): file:// attachment paths must point to file:///mnt/sdcard. Ignoring attachment file:///data/data/my.package.name/files/myfile.txt</p>
</blockquote>

<p>How should I interpret this?<br>
 - Can I NEVER attach an internal memory file to a GMail?<br>
 - Do I need to change permissions?<br>
 - Do I need to construct my URI in different way?  </p>

<p>Here's the code snippet that created the EXTRA_STREAM:</p>

<pre><code>String filename = "file://" + getFilesDir().toString() + "/myile.txt";  
myintent.putExtra(Intent.EXTRA_STREAM, Uri.parse(filename));
</code></pre>

<p>BTW this works fine with built-in Android mail. It just fails on GMail.</p>
