0

私のアプリケーションでは、添付ファイルとしてではなく、本文で画像を送信する必要があります。私は1週間以上費やしましたが、成功は見られませんでした. JavaメールAPIを介して同じものを実装しました。しかし、意図的に実装する必要があります。私が試したことは次のとおりです。

Spanned emailText11 =   Html.fromHtml("<body><p><img src=\"http://www.datarecoverydownloadwebsite.com/drdwebsite/image/pen-drive1.jpg\" alt=\"Smiley face\" align=\"bottom\" width=\"32\" height=\"32\" /></p></body>", new Html.ImageGetter() {
            @Override
            public Drawable getDrawable(String source) {
                 Drawable drawFromPath;
                 int path = Inline_Image_Gmail.this.getResources().getIdentifier(source, "drawable", "com.package..."); 
                 drawFromPath = (Drawable) Inline_Image_Gmail.this.getResources().getDrawable(path);
                 drawFromPath.setBounds(0, 0, drawFromPath.getIntrinsicWidth(), drawFromPath.getIntrinsicHeight());
                 return drawFromPath;

            }
    }, null);

emailIntent.putExtra(Intent.EXTRA_STREAM,emailText11);

私はたくさんグーグルで検索しましたが、それは不可能です。そうでない場合、誰かがこの理由を明確にすることができます。

ありがとう。

4

0 に答える 0