0

I would like to change the text colour of text inside html file to white colour as I have changed the background colour to black. How can I achieve this?

webView = (WebView) findViewById(R.id.webview);
webView.loadUrl("file:///android_asset/page1.html");
webView.setBackgroundColor(Color.parseColor("#000000"));

Thanks guys :)

  • check the link looks similar ask, hope it helps you https://stackoverflow.com/questions/1254970/changing-text-color-in-a-webview – TRK P Nov 02 '21 at 14:12

1 Answers1

0

It's impossible to update directly the content displayed in a webview by a webview method. The only way to update the text color is to update the content of page1.html in your case. Webview role is only to display an html content, not to update it.

SebastienRieu
  • 1,443
  • 2
  • 10
  • 20