Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle-Charts won't show in WebView (Android 4.0.4)
    primarykey
    data
    text
    <p>I've encountered a problem with Google-Charts in the WebView on Android 4.0.4</p> <p>I've got a little page with a Google-Chart on it, so if I display this html-page in the browser the chart shows up just fine. If I start my App on the Samsung Galaxy 7 (Android 2.2) the Google-Chart shows up just fine in the WebView too. But if I start the same App on the Samsung Galaxy 10.1 (Android 4.0.4) the WebView with the Google-Chart is just empty, no error-message or something else, that might be usefull for debugging.</p> <p>Essentially I just try to load the Google-Chart URL into the WebView:</p> <pre class="lang-java prettyprint-override"><code>String url = &lt;google-chart-url&gt;; // is there something strange with the content? showContent(url); WebView webview = ((WebView) findViewById(R.id.webview)); webview.loadUrl(url); </code></pre> <p>Little HTTP-Request to verify that the data from the server is okay:</p> <pre class="lang-java prettyprint-override"><code>private void showContent(String url) { int TIMEOUT_CONNECTION = 60000; int TIMEOUT_SOCKET = 60000; // Parameter setzen HttpParams httpParams = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(httpParams, TIMEOUT_CONNECTION); HttpConnectionParams.setSoTimeout(httpParams, TIMEOUT_SOCKET); HttpClient httpClient = new DefaultHttpClient(httpParams); // Daten holen HttpGet getMethod = new HttpGet(url); HttpResponse response; String raw = new String(); try { response = httpClient.execute(getMethod); HttpEntity responseEntity = response.getEntity(); if(responseEntity != null) { raw = EntityUtils.toString(responseEntity); } Log.d(LOG_TAG, "showContent: " + raw); } catch (IOException e) { Log.e(LOG_TAG, e.getMessage(), e); } } </code></pre> <p>I also tried different WebView settings:</p> <pre class="lang-java prettyprint-override"><code>WebView webview = (WebView) findViewById(R.id.webview); // JavaScriptInterface to handle clicks in the WebView webview.addJavascriptInterface(new HtmlClick(), "clicks"); webview.getSettings().setJavaScriptEnabled(true); webview.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); </code></pre> <p>Is there anyone who encountered a similiar problem or does someone have suggestions what is actually bugged?</p> <p>Thanks in advance ;)</p> <h3>Update:</h3> <p>The Browser on the Samsung Galaxy 10.1 also dosen't display the chart; tested with:</p> <ul> <li>Internet</li> <li>Chrome</li> <li>Firefox</li> <li>Opera</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload