Problem Attaching internal file to GMail in my android app
<p>My app writes data to text files (on sd card and internal memory).
Later the app emails the text files to a list of people.
I am having trouble getting gmail to attach a file that is pulled from the internal application files area. 'Native Android mail' can attach a file from either internal or SD card area with no problem. Gmail will attach a file if it's from SD card, but won't attach a file if its located in internal storage.    </p>

<p>// this sends a file from SD - works for android mail and gmail</p>

<pre><code>Intent jj=new Intent(android.content.Intent.ACTION_SEND);

String fileName = "file://" + Environment.getExternalStorageDirectory()+"/aFolder/externalfile.txt"           

jj.putExtra(Intent.EXTRA_STREAM, Uri.parse(fileName));
jj.setType("text/plain");

Intent chooser = Intent.createChooser(jj , "Select Sender");
startActivity(chooser);
</code></pre>

<p>// this sends an internal file-works for android mail, but no attachment sent with gmail</p>

<pre><code>Intent jj=new Intent(android.content.Intent.ACTION_SEND);

String fileName = "file://" + getFilesDir().toString() + "/internalfile.txt";

jj.putExtra(Intent.EXTRA_STREAM, Uri.parse(fileName));
jj.setType("text/plain");

Intent chooser = Intent.createChooser(jj , "Select Sender");
startActivity(chooser);
</code></pre>

<p>Any suggestions?
Do I need to give Gmail special permission somehow?<br>
My attachments are all text files - written by the app.<br>
Internal files were created with openFileOutput(myFile,32769)</p>

<p>Thanks
John D</p>
