This is the HTML file I want to display on the Textview :
<html>
<head>
<link rel="stylesheet" href="highlight/styles/default.css">
<script src="highlight/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
<h1>C Program to Calculate Area of Circle</h1>
<p class="test"><pre><code class="c">#include<stdio.h>
int main() {
area = 3.14 * radius * radius;
printf("\nArea of Circle : %f", area);
}
</code></pre></p>
<br>
<!--Output-->
<div><br>Enter the radius of Circle : 2.0<br>
Area of Circle : 6.14<br> </div>
</body>
</html>
It has external linking to some .js and .css files
I've stored it in assets folder.
htmlContentInStringFormat="";
String htmlFilename = "www/"+fileName;
AssetManager mgr = getBaseContext().getAssets();
InputStream in = mgr.open(htmlFilename, AssetManager.ACCESS_BUFFER);
htmlContentInStringFormat = StreamToString(in);
in.close();
I'm using mTextview.setText(Html.fromHtml(htmlContentInStringFormat)), but it is displaying plain text. I want proper stylized text, as it is displayed when I open the .html file like this :
Please help me.