jQuery Flot charting library in Android WebView doesn't work correctly
I'm trying to implement Flot charts in my Android app using WebView. Basically I have a Fragment which contains a WebView. I also have a refresh button which refreshes the Fragment (and the WebView thus) by retrieving new data from a web service and putting them in the chart.
The problem I'm having is that the WebView at first launch (when the fragment is created) either doesn't show the chart or it shows a smaller chart (i.e. half screen). When I click refresh the chart shows fine without any problem, so the problem is only when the fragment is first created.
What I do on onCreateView is calling this:
I also have overrided the onResume method where I call the refresh() function.
Just a guess but...
webView.loadUrl() is asynchronous. I think your first AsyncTask executes before the loadUrl completes. I'd recommend to do your initial displayChart in an onPageFinished.