in Android Code Tips, Programming

WebView: Change background and font color

In order to change a WebView’s background color there is a standard way:


In order to change a WebView’s text font color there is no standard way:
Either you change the font through the html code, or you do this:

htmlData="<font color='black'>" + htmlData + "</font>";
mWebView.loadDataWithBaseURL(null, htmlData, "text/html", "UTF-8", null);