Bastaix
Bastaix

Reputation: 845

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 knows 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

Upvotes: 1

Views: 94

Answers (2)

olivierg
olivierg

Reputation: 10240

Replace carriage returns with <br /> tags, eg:

html = Html.fromHtml(body.replace("\n", "<br/>"));

Upvotes: 1

Rajath
Rajath

Reputation: 11946

Can you try to print Html.fromHtml(body) to your log and see if the ENTER is seen?

Upvotes: 0

Related Questions