How to share an HTML file with various apps via ACTION_SEND Intent
<p>I'm trying to send an HTML file to Google Docs on Android via the "Share" button. The code I'm using at the moment is basically:</p>

<pre><code>Intent share = new Intent(Intent.ACTION_SEND);
share.setType(mimeType);
share.putExtra(Intent.EXTRA_STREAM, Uri.parse(file.getPath()));
startActivity(Intent.createChooser(share, "Some Title");
</code></pre>

<p>"file" is of type File and points to some file on storage somewhere. I get the Mime Type by using the MimeTypeMap.getMimeTypeFromExtension() method (I wasn't sure what it should be, but I'm fairly sure i resolves to text/html).</p>

<p>The above code works fine for sharing the file with Dropbox, but with Google Docs I get a notification that the upload fails. Also, the default email client just force closes and the attachment fails with GMail.</p>

<p>The default file manager on the device I'm using (ASUS Transformer running 3.2) also has the "Share" option and everything works fine with the same files there (Dropbox, GDocs, Mail), so clearly I'm missing something, but I have no idea what. Any help would be appreciated.</p>
