title: WebView fails to render until touched Android 4.2.2
body: <p>I am developing an open-source browser called Lightning Browser, and I have run into some trouble with the most recent update to Android (4.2.2).</p>
  
  <p>WebViews will fail to render completely until the view is touched. It only occurs on the latest Android version. On 4.2.1, the WebView rendered completely fine. I use my Nexus 7 for development and right after I received the 4.2.2 update, the browser stopped rendering. Other users experienced this as well, and it was confirmed multiple times to happen ONLY on 4.2.2. It is happening targeting API level 16 and 17, but I have seen a WebKit browser that targets API level 9 without this problem.</p>
  
  <p>I have attempted to remedy this using the solution to a problem I found here on Stack Overflow (<a href="https://stackoverflow.com/questions/13500452/android-webview-renders-blank-white-view-doesnt-update-on-css-changes-or-html">Android WebView renders blank/white, view doesn&#39;t update on css changes or HTML changes, animations are choppy</a>). HOWEVER, setting the WebView's RenderPriority to high alone does not solve it... the only way to get it to render without being touched was to place the invalidate() command inside the OnDraw() method of WebView. This causes the WebView to re-draw continuously. This works (sort of), animations are smooth, the page loads very quickly, but it causes the WebView's performance to drop otherwise. </p>
  
  <p>I have also seen this question (very similar to mine), but there is no good answer for it. <a href="https://stackoverflow.com/questions/10387345/android-webview-fails-to-completely-render-content-until-user-interaction">Android WebView Fails to Completely Render Content Until User Interaction</a></p>
  
  <p>By performance drop, I mean input. Text input lags, and the WebView itself cannot handle what is going on as well as before. Benchmarking the browser with the invalidate() method call drops Benchmarking performance by around 8%. I know benchmarks aren't everything, but it's telling me that the continuous drawing is straining the system and causing the system to ignore other tasks.</p>
  
  <p>In Conclusion...
  The WebView in Android 4.2.2 will not render until touched. The only way I know to fix this is to call invalidate() in the onDraw() method of WebView. This is bad for performance and I am looking for a different way to fix this.</p>
  
  <p>The Magic Code (I'm currently using)... </p>
  
  <pre><code>class MyWebView extends WebView
  {
      @Override
      onDraw(Canvas canvas)
      {
          invalidate(); 
          super.OnDraw(canvas);
      }
  }
  </code></pre>
  
  <p>remove</p>
  
  <pre><code>invalidate();
  </code></pre>
  
  <p>and it doesn't render until touched.</p>
  
  <p>Does anyone have a suggestions on how make the WebView render (other than what I've done)? By the way, this is my first question I've asked here on Stack, so forgive me if I haven't been clear or if I've done something wrong. </p>
  
  <p>EDIT:
  I found this question <a href="https://stackoverflow.com/questions/11344125/android-chromium-disk-cache-error-corrupt-index-file">here</a> about a similar issue and it was resolved, the problem is, I don't understand what the answer even means. If anyone could enlighten me it might help. </p>
  
  <p>I get this error in logcat</p>
  
  <pre><code>E/chromium(1243): external/chromium/net/disk_cache/backend_impl.cc:2022: [0705/172030:ERROR:backend_impl.cc(2022)] Corrupt Index file
  </code></pre>