I am new to android development. I am using webview to display HTML pages in android, but only the text shows up. Can you please help me with the problem. thank you in advance, would be very helpful.
WebView view = (WebView) this.findViewById(R.id.webView);
try{
InputStream stream = this.getAssets().open("Capacitor Code Calculator.html");
int streamsize = stream.available();
byte[] buffer = new byte[streamsize];
stream.read(buffer);
stream.close();
String html = new String(buffer);
view.loadData(html,"text/html", "utf-8");
}
catch (Exception e){
e.printStackTrace();
Does it have to do something with "text/html" in view.loadData(html,"text/html", "utf-8");
I have my html and image file both in assets folder.