title: How to share *.txt file in android
body: <p>I tried many ways but I can't do this.</p>
  <p>I have a *<strong>.txt</strong> file. I want to share it via <code>Bluetooth, wifi, email and ...</code>.</p>
  <p>When i used this code i cant share the file:</p>
  <pre><code>  File file = new File(Environment.getExternalStorageDirectory(), &quot;Email-Ghap/Emails.txt&quot;);
          Intent sharingIntent = new Intent(Intent.ACTION_SEND);
          sharingIntent.setType(&quot;*/txt&quot;);
          sharingIntent.putExtra(Intent.EXTRA_STREAM, file);
          startActivity(Intent.createChooser(sharingIntent, &quot;share file with&quot;));
  </code></pre>
  <p>Totally I want this: when the user clicked on the share button and chooses one email sender like <strong>Gmail</strong> for sharing. the file must be attached file for the new email ...</p>
  <p>I found this link <a href="https://stackoverflow.com/a/16036249/4016922">https://stackoverflow.com/a/16036249/4016922</a></p>
  <p>But it shares txt file content. I want to share the file not the content of the txt file</p>