title: Moving MapFragment (SurfaceView) causes black background flickering
body: <p>I'm trying to implement new Android Google Maps API (v2). However it doesn't seem to go well with <a href="https://github.com/jfeinstein10/SlidingMenu" rel="noreferrer">SlidingMenu</a>. As you may know, <code>MapFragment</code> implementation is based on <code>SurfaceView</code>. The problem is that the <code>SurfaceView</code> doesn't like moving it around - I mean placing it in movable views:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/13837697/viewpager-with-google-maps-api-v2-mysterious-black-view/13993640#13993640"><code>ViewPager</code></a>, </li>
  <li><a href="https://stackoverflow.com/questions/13746351/mapfragment-in-scrollview"><code>ScrollView</code></a>, </li>
  <li><a href="https://stackoverflow.com/questions/14218124/new-gms-maps-mapview-rendering-lags-a-bit-when-in-a-listview?lq=1"><code>ListView</code></a>,</li>
  <li>or the aforementioned <code>SlidingMenu</code>. </li>
  </ul>
  
  <p>When you move it, it leaves a black hole in the place where its pixels originally layed. It looks something like <a href="https://f.cloud.github.com/assets/2045380/11888/0cf2b480-456b-11e2-8633-277dac130328.png" rel="noreferrer">this</a>.</p>
  
  <p>This problem can be partially solved by specifying a transparent background on the <code>SurfaceView</code> or even placing a transparent <code>View</code> over it. I just can't figure if only for me the results are unacceptable, or if I have a different problem which makes it look how it looks. </p>
  
  <p><strong>To see how it looks, please watch <a href="http://youtu.be/qSBuFqMliJM" rel="noreferrer">THIS VIDEO</a>.</strong></p>
  
  <p>(sorry for the quality, but the problem can be seen easily anyway)</p>
  
  <p>When a normal listview (the orange screen) is pulled away while opening <code>SlidingMenu</code>, the animation is smooth and nice. But as soon as the <code>MapFragment</code> appears, there's some weird refreshing/flickering/synchronization issue on the map.</p>
  
  <p>Tested on HTC One S and Samsung Galaxy ACE.</p>
  
  <hr>
  
  <p><strike>My super-duper-crazy idea of solving it: each time the opening animation starts, take a screenshot of the <code>MapFragment</code> (it should be possible with SurfaceView) and lay it over for the duration of the animation. But I really don't know how to do it...</strike>
  <a href="https://stackoverflow.com/questions/13773658/capture-screen-shot-of-googlemap-android-api-v2">Taking screenshot of a map isn't possible</a>, but maybe someone will get inspired by this.</p>
  
  <p>Or maybe disable redrawing the map some other way, I don't know. </p>
  
  <hr>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Found <a href="http://android-developers.blogspot.com/2011/11/android-40-graphics-and-animations.html" rel="noreferrer">this</a>.</p>
  
  <p>It appears that SurfaceView can be changed to TextureView to remove those limitations. But since MapFragment is based on SurfaceView, I don't know if it can be achieved.</p>
  
  <p><strong>Another update</strong>
  It appears that this issue has been resolved on devices 4.1+. They just used TextureView. but on lower versions we still have to use workarounds.</p>