Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: Intent.ACTION_SEND with EXTRA_STREAM doesn't attach any image when choosing Gmail app on htc Hero
    primarykey
    data
    text
    <p>On the Emulator with a default mail-app all works fine. But I have no attach when I'am receiving a mail which I've sent from my Hero using a Gmail app. The default Mail app on the hero works fine. </p> <p>How can I make this code works with Gmail app on Hero?<br/> You can see the code below.</p> <pre><code> private void startSendIntent() { Bitmap bitmap = Bitmap.createBitmap(editableImageView.getWidth(), editableImageView.getHeight(), Bitmap.Config.RGB_565); editableImageView.draw(new Canvas(bitmap)); File png = getFileStreamPath(getString(R.string.file_name)); FileOutputStream out = null; try { out = openFileOutput(getString(R.string.file_name), MODE_WORLD_READABLE); bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); out.flush(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (out != null) out.close(); } catch (IOException ignore) {} } final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(png)); emailIntent.setType("image/png"); startActivity(Intent.createChooser(emailIntent, getString(R.string.send_intent_name))); } </code></pre> <p>in Logs I see the following:</p> <pre><code>02-05 17:03:37.526: DEBUG/Gmail(11511): URI FOUND:file:///sdcard/DCIM/100MEDIA/IMAG0001.jpg 02-05 17:03:37.535: DEBUG/Gmail(11511): ComposeActivity added to message:0 attachment:|IMAG0001.jpg|image/jpeg|0|image/jpeg|LOCAL_FILE|file:///sdcard/DCIM/100MEDIA/IMAG0001.jpg size:0 02-05 17:03:37.585: INFO/Gmail(11511): &gt;&gt;&gt;&gt;&gt; Attachment uri: file:///sdcard/DCIM/100MEDIA/IMAG0001.jpg 02-05 17:03:37.585: INFO/Gmail(11511): &gt;&gt;&gt;&gt;&gt; type: image/jpeg 02-05 17:03:37.585: INFO/Gmail(11511): &gt;&gt;&gt;&gt;&gt; name: IMAG0001.jpg 02-05 17:03:37.585: INFO/Gmail(11511): &gt;&gt;&gt;&gt;&gt; size: 0 </code></pre> <p>Thank you for the answer.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload