0

私の目的は、その画像でhtmlファイルを開くことです(画像リンクはhtmlページで利用できます)。

Intent shareIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:"));
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "The Subject");
shareIntent.putExtra(Intent.EXTRA_TEXT,Html.fromHtml(new StringBuilder().append("<p><b>Some Content</b></p>").append("<small><p>More content</p></small>").append("<img src=\"http://upload.wikimedia.org/wikipedia/commons/thumb/f/f9/Wiktionary_small.svg/350px-Wiktionary_small.svg.png\"/>").toString()));
startActivity(shareIntent);

試してみましたが、画像ではなくobjを表示しています。

4

1 に答える 1

1

これを試して..

String body="<!DOCTYPE html><html><body><a href=\"http://www.w3schools.com\" target=\"_blank\">Visit W3Schools.com!</a>" +
                      "<p>If you set the target attribute to \"_blank\", the link will open in a new browser window/tab.</p></body></html>";
            final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
            emailIntent.setType("text/html");           
            emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);    
            emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(body));
            startActivity(Intent.createChooser(emailIntent, "Email:"));
于 2013-05-16T04:45:34.083 に答える