I have data with some of the html tag, and I want to display it in webView.
I tried below code:
String html = "<html><body><font face=\"verdana\" size=\""
+ getResources().getString(R.string.WebView_Font_Size)
+ "\" color=\"rgb(64,64,64)\">"
+ Article.getDetaildescription().replaceAll("h2", "h4")
+ "</font></body></html>";
String mime = "text/html";
String encoding = "utf-8";
Log.e("htmlstring", html);
description.loadDataWithBaseURL(null, html, mime, encoding, null);
Issue is: whenever above code executes, nothing loads in webview. But as soon as I lock device & unlocked it, my webview displays that data.
your code seems ok. check your xml file it might helping you .. i wonder if you are dynamically set visibility of any your layout or something ..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With