title: How to work around the delayed/slow WebView rendering which occurs on some devices?
body: <p>When utilizing a WebView to display simple formatted text (no remote content loading), some devices like the Nexus 4 or Galaxy Nexus have a very notable delay between onPageFinished() and actually displaying the text. If the WebView is used in a dynamic vertical layout with it's height set to wrap_content, all elements below will visibly <em>jump</em> down and hence create a very bad user experience.</p>
  
  <p>For example:</p>
  
  <pre><code>public class WebViewActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_web_view);
          WebView webview = (WebView) findViewById(R.id.webview);
          webview.loadData("&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;WebView rendering is slow on some devices like the Nexus 4!&lt;/body&gt;&lt;/html&gt;", "text/html", "utf-8");
      }
  }
  </code></pre>
  
  <p>With <code>R.layout.activity_web_view</code> being</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent" android:layout_height="match_parent"
      android:orientation="vertical"
      android:background="#AAA" &gt;
  
      &lt;WebView android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/webview"/&gt;
  
      &lt;TextView android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:textSize="20sp"
          android:layout_margin="5dp"
          android:text="Elements below the WebView are jumping down when rendering is completed."/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>A demo project with this code can be found at <a href="https://github.com/rodja/webview-slow-rendering-demo" rel="nofollow noreferrer">https://github.com/rodja/webview-slow-rendering-demo</a></p>
  
  <p>How can I best work around this issue? <a href="https://stackoverflow.com/questions/7422427/android-webview-slow">Speed up tips</a> I found on StackOverflow seems not to help. Is hiding the whole LayoutGroup <a href="https://stackoverflow.com/questions/9828617/how-to-know-when-webview-rendering-is-finished">until rendering is done</a> the only option?</p>