title: Orientation change messes with hardware acceleration settings
body: <p>I'm developing an app with sdk 11 (Honeycomb). In this app I make use of hardware acceleration (at application level) to make animations smoother and without it, they are unacceptably sluggish. Since my client really wants to have them, I have to find another solution than turning the acceleration off.</p>
  
  <p>The problem itself is that I have an <code>Activity</code> which contains few <code>WebView</code> elements. 3, to be exact - 1 is always shown and 2 others are used for preloading pages, so they are invisible (I mean positioned off the screen, but still "visible"). I use translation animation to "switch" between them. With hardware acceleration on, they render web pages incorrectly - I get big, flickering black boxes over the page. This is of course unacceptable, so I bypassed the problem by turning hardware acceleration off for all WebViews:</p>
  
  <pre><code>webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
  </code></pre>
  
  <p>I've also tried to set this in xml file (<code>android:layerType="software"</code>), but it worked exactly the same way (as it should be). Anyway, both those methods work pretty well - the animations and WebViews are smooth enough and there are no artifacts. The problem arises however once the orientation changes. Even though I make no important distinctions between portrait and landscape mode in my code, it works like this:</p>
  
  <ul>
  <li>Activity starts in portrait mode, change orientation to landscape, back to portrait, and so on. Everything works as expected.</li>
  <li>Activity starts in landscape mode. It works fine. Orientation changes to portrait. Artifacts start to show again. Most often whole screen just goes black with webpage showing through once in the blue moon when I scroll/zoom the page. This is exactly the same as if the WebViews used hardware acceleration. Back to landscape - it works fine again. </li>
  </ul>
  
  <p>This had led me to think that the hardware acceleration might be the problem. I was proved myself right by trying to set software acceleration at different levels of view hierarchy to see if this strange behavior stops. I found out that it does indeed stop, and it works without bugs, but only once whole Activity is software accelerated, which is unacceptable to me (my translation animations! [+slow scrolling in webviews]). If only views/viewgroups in the layout xml file are set to be software accelerated, it still bugs. Is there anything about orientation changes which can trigger such behavior? Any solutions, hacks, hints, suggestions, ideas, thoughts, however incomplete, are welcome - I'm out of those.</p>
  
  <p>If you need more info or some code, I will gladly provide it to you. <br />
  Thank you for your time!</p>