Android mailing problem
I have a little but annoying problem. I have made an app where the user can give some directions and then send them by email later.
The problem is that when the user send the directions it do not change line if the user have pressed enter in the app. I am storing the directions as a String
in the database on the phone.
It is showed correctly in the app.
Anyone kn开发者_如何学编程ows what can be done?
EDIT
I am sending the mail by
intent = new Intent(android.content.Intent.ACTION_SEND);
intent.setType("text/html");
intent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(body));
context.startActivity(Intent.createChooser(intent, "Share Via:"));
Thank you
Replace carriage returns with <br />
tags, eg:
html = Html.fromHtml(body.replace("\n", "<br/>"));
Can you try to print Html.fromHtml(body)
to your log and see if the ENTER
is seen?
精彩评论