title: View too large to fit into drawing cache when calling getDrawingCache()
body: <p>I'm trying to take a screenshot of the contents of a LinearLayout.  The layout contains a scrollview that can be of variable height/width.  This code works fine when the layout is not too big (i.e. you don't need to scroll very much off screen to see everything):</p>
  
  <pre><code>View v1 = (LinearLayout)theLayout;
  
  v1.setDrawingCacheEnabled(true);
  Bitmap bitmap = Bitmap.createBitmap(v1.getDrawingCache());
  v1.setDrawingCacheEnabled(false);
  </code></pre>
  
  <p>However, if the LinearLayout that I'm trying to capture is large, then the application crashes with a null pointer on v1.getDrawingCache().</p>
  
  <p>There is an error in logcat:</p>
  
  <blockquote>
    <p>05-11 13:16:20.999: W/View(17218): View too large to fit into drawing
    cache, needs 4784400  bytes, only 3932160 available</p>
  </blockquote>
  
  <p>How can I properly take a screenshot of this layout?  Is there another way to go about it that doesn't use so much memory?</p>