I have an email body and it has html,css tags and I am trying to retrieve only the body text in Android.
I used;
String.valueOf(Html.fromHtml(body);
and that gave me the text with css tags. What should I do for retrieve only the text? Result is holding in a String
Normally (when I first receive body );
<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
TEXTONE<div>TEXTTWO</div> </div></body>
</html>
After String.valueOf(Html.fromHtml(body);
<!-- .hmmessage P { margin:0px; padding:0px } body.hmmessage { font-size: 10pt; font-family:Tahoma } -->
TEXTONE
TEXTTWO
I just want to receive TEXTONE and TEXTTWO