email attachment android?
<p>I want to send an email with an attachment(a picture that i selected from gallery).but the code have problem!!!! can you help me please??</p>

<pre><code>public void galleria(View v){
     Intent in = new   Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
     startActivityForResult(in, RESULT_LOAD_IMAGE);
}

protected void onActivityResult(int requestCode, int resultCode, Intent data) {  

    super.onActivityResult(requestCode, resultCode, data);     

    if (requestCode == RESULT_LOAD_IMAGE &amp;&amp; resultCode == RESULT_OK &amp;&amp; null != data){

         Uri selectedImage = data.getData();
            String[] filePathColumn = { MediaStore.Images.Media.DATA };
            Cursor cursor = getContentResolver().query(selectedImage,filePathColumn, null, null, null);
            cursor.moveToFirst();
            int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
            String picturePath = cursor.getString(columnIndex);
            cursor.close();
            thumbnail = (BitmapFactory.decodeFile(picturePath));
    }
} 

public void k(View v){

final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
    emailIntent.setType("plain/text");
    emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"stefano.pietrella@gmail.com"});
    emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Object");
    emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Message...");

    //Uri attachment = Uri.parse("file:///sdcard/fil.txt");
    emailIntent.putExtra(Intent.EXTRA_STREAM,thumbnail);

    startActivity(Intent.createChooser(emailIntent, "Send email..."));
}
</code></pre>
