title: Mail attachment does not have correct Content-Type
body: <p>I want to enable my Android app to send a file from one device to another device in various ways (mail, bluetooth, whatever).</p>
  
  <p>My first use case is email. This is the code I'm using to generate my SEND intent.</p>
  
  <pre class="lang-java prettyprint-override"><code>            Intent shareIntent = new Intent();
              shareIntent.setAction(Intent.ACTION_SEND);
              shareIntent.setType("text/xml");
              shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
              startActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.share_list)));
  </code></pre>
  
  <p>When I run this on the simulator (Android 2.1), the attachment section of the resulting mail reads:</p>
  
  <pre><code>Content-Type: ;
  </code></pre>
  
  <p>However, when I run this on my Galaxy Nexus (Android 4.2.2), the attachment section reads:</p>
  
  <pre><code>Content-Type: application/tpl;
  </code></pre>
  
  <p>This might be because the passed URI ends in <code>.tpl</code>.</p>
  
  <p>This is what I would have expected:</p>
  
  <pre><code>Content-Type: text/xml;
  </code></pre>
  
  <p>Am I missing something here? It is important that the mail attachment has the correct MIME type so I can use intent filters for the receiving side of the application.</p>