Reputation: 845
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
Reputation: 10240
Replace carriage returns with <br />
tags, eg:
html = Html.fromHtml(body.replace("\n", "<br/>"));
Upvotes: 1
Reputation: 11946
Can you try to print Html.fromHtml(body)
to your log and see if the ENTER
is seen?
Upvotes: 0