Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Data not loading in WebView but it loads after lock - unlock device

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.

like image 516
rajpara Avatar asked Nov 12 '22 23:11

rajpara


1 Answers

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 ..

like image 80
jaimin Avatar answered Dec 24 '22 22:12

jaimin