How Can I Send Mail From My App With Underline Or Bold Text?
My code: String html = 'underline'; Intent intent = new Intent(Intent.ACTION_SEND, Uri.p
Solution 1:
You cannot use the type text/html
with Intent.EXTRA_TEXT
according to this documentation. Have you tried with EXTRA_STREAM
?
On the other hand, you have a HTML sintax error in the bold tag:
String html = "<html><body><b<bold</b><u>underline</u></body></html>";
should be:
String html = "<html><body><b>bold</b><u>underline</u></body></html>";
UPDATE:
It may be a bug in your default email app, have a go with the Gmail app if you can and see what happens. Change the code a bit to choose again your default mail client:
try {
startActivity(Intent.createChooser(intent, "Send mail"));
Log.i("MAIL", "Finished sending email");
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(getApplicationContext(),
"There is no email client installed.", Toast.LENGTH_SHORT).show();
}
As you can see in the picture below, it works with the default Mail app of the Android framework.
Have you tried for example with the Project Build Target to 4.3?
Post a Comment for "How Can I Send Mail From My App With Underline Or Bold Text?"