title: How to attach image in email from drawable in android
body: <p>I am attaching an image from drawable folder and sending it in a email.
  when  I send it from default email client.Image extension(.png) is missing in attachment
  and and also the file name is changed itself.
  I want t send image with default name(as in drawable) and with .png extension.</p>
  
  <p>this is my code.</p>
  
  <pre><code>    Intent email = new Intent(Intent.ACTION_SEND);
              email.setType("image/png");
  
              email.putExtra(Intent.EXTRA_EMAIL, new String[] { to });
  
              email.putExtra(Intent.EXTRA_SUBJECT, "Hey! ");
  
  
              email.putExtra(Intent.EXTRA_STREAM, Uri.parse("android.resource://"+ getPackageName() + "/" + R.drawable.ic_launcher));
  startActivity(Intent.createChooser(email, "Sending........"));
  </code></pre>
  
  <p>Please suggest me what is worng in this code 
  thanks.</p>