Reputation: 1639
my code looks like this
txtData=(EditText)findViewById(R.id.textbox);
txtData.setText(Html.fromHtml("<b><html></b>"));
as you can see i am trying to make HTML code appear in an EditText box. I am trying to use HTML tags using the Html.fromHtml() method to format the HTML code that appears in the box. i need to find a way to escape the '<' and '>' tags around the word html from being processed by the fromHtml method. any suggestions on how to do this ?
Upvotes: 1
Views: 1271
Reputation: 69198
You should use
<
and
>
as in this example
txtData.setText(Html.fromHtml("<b><html></b>"));
Upvotes: 1
Reputation: 132972
try this:
txtData=(EditText)findViewById(R.id.textbox);
txtData.setText(Html.fromHtml("<b><html></b>"));
or
txtData=(EditText)findViewById(R.id.textbox);
txtData.setText(Html.fromHtml("<b><html></b>"));
Upvotes: 1