Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to send mail text with image in compose mail body
    primarykey
    data
    text
    <p>I am not able to view the image in mail body. Its just appearing like dotted small box.</p> <pre><code> setContentView(R.layout.mailshare); send = (Button)findViewById(R.id.button1); address = (EditText)findViewById(R.id.emailaddress); //subject = (EditText)findViewById(R.id.emailsubject); // emailtext = (EditText)findViewById(R.id.emailtext); Bundle extras = getIntent().getExtras(); if(extras != null) { String emailtitle = extras.getString(TEXT_DATA); if(emailtitle != null) { subject = (EditText)findViewById(R.id.emailsubject); if(subject != null) { subject.setText(emailtitle); } } } Bundle mailmsg = getIntent().getExtras(); if(mailmsg != null) { String bodytext = mailmsg.getString(BODY_TEXT); if(bodytext != null) { emailtext = (EditText)findViewById(R.id.emailtext); if(subject != null) { emailtext.setText(bodytext); } } } send.setOnClickListener(new OnClickListener() { public void onClick(View v) { [enter link description here][2]// // TODO Auto-generated method stub final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{ address.getText().toString()}); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject.getText()); emailIntent.setType("image/png"); Spanned html =Html.fromHtml("&lt;html&gt;&lt;body&gt; &lt;img src='http://www.example.com/logo.png'&gt; &lt;/body&gt;&lt;/html&gt;", new ImageGetter() { InputStream s; public Drawable getDrawable(String url) { try { s = (InputStream) (new URL(url)).getContent(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } Drawable d = Drawable.createFromStream(s, null); // Log.debug(this, "Got image: " + d.getClass() + ", " + d.getIntrinsicWidth() + "x" + d.getIntrinsicHeight()); d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight()); return d; }},null); // emailIntent.putExtra(emailIntent.EXTRA_TEXT, html); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, html); startActivity(Intent.createChooser(emailIntent, "Send mail...")); } }); } </code></pre> <p>} </p>
    singulars
    1. This table or related slice is empty.
    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.
    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