0

My webview charge viewing a page from a server

private String url = "http://192.168.33.37/gestpresenze/index.html";

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.webview);
    //carichiamo la webview dentro il layout specificato
    mWebView = (WebView) findViewById(R.id.webView1);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setLoadsImagesAutomatically(true);
    mWebView.getSettings().setDomStorageEnabled(true);
    mWebView.getSettings().setGeolocationEnabled(true);


    mWebView.setWebChromeClient(new WebChromeClient());
    mWebView.loadUrl(url);
}

Is it possible that user view this page with a font determined not by the CSS of the page on the server but from a font of the app?

For example, the method setDefaultFixedFontSize sect font established or that of the CSS of the page loaded ?

kartikmaji
  • 946
  • 7
  • 22
Angelo Solla
  • 39
  • 1
  • 9

1 Answers1

0

Look here Rendering HTML in a WebView with custom CSS , you have to retrieve the html and modify with a custom css. You have to do a kind of merge with the other post.

Community
  • 1
  • 1
  • this seems to me the best solution http://stackoverflow.com/questions/30018540/inject-css-to-a-site-with-webview-in-android – Angelo Solla Dec 21 '15 at 09:49