0

I'm looking for a way to dynamically change the style (css) applied to a web page in a webview. Can someone help me?

For example, I want to be able to dynamically modify the style file to include in the head tag of my html page. Depending on the content of a sharepreference variable, I will change the style of the page. Thank you.

AndrewL64
  • 15,794
  • 8
  • 47
  • 79
kfir88
  • 380
  • 2
  • 16
  • You can try to use JS interface to manipulate. All ther required things to start are mentiond here https://developer.android.com/guide/webapps/webview – Ishan Fernando May 20 '18 at 16:25
  • I tried this but it only seems useful when I want to run java code from my web page. I could not do the opposite. if you have an example that would be cool – kfir88 May 20 '18 at 16:48
  • Actually, you're looking for the way to call js in your java environment, so check this [answer](https://stackoverflow.com/a/31291128/5356531) – Dmitry Nevzorov May 20 '18 at 19:45
  • I tried this but it only seems useful when I want to run java code from my web page. I could not do the opposite. if you have an example that would be cool – kfir88 May 22 '18 at 14:38
  • style looking for any help please! – kfir88 Jun 27 '18 at 22:43

0 Answers0