When anyDensity=false why does getDrawingCache(true) return null?
<p>First off, my application currently defines anyDensity=false in the manifest file. Elsewhere in the app, I'm trying to capture and display a View's DrawingCache but I'm not able to get a clear Bitmap without scaling artifacts.</p>

<p>The code below yields a Bitmap but it has scaling artifacts and is generally fuzzy.</p>

<pre><code>myView.setDrawingCacheEnabled(true);
Bitmap myBitmap = Bitmap.Create(myView.getDrawingCache());
myImageView.setImageBitmap(myBitmap);
</code></pre>

<p>As I read it, the documentation for getDrawingCache says this is to be expected and to use getDrawingCache(true). Yet, both code examples below throw NullPointer exceptions because the Bitmap returned by getDrawingCache(true) is always null.</p>

<pre><code>myView.setDrawingCacheEnabled(true);
Bitmap myBitmap = Bitmap.Create(myView.getDrawingCache(true));
myImageView.setImageBitmap(myBitmap);
</code></pre>

<p>OR</p>

<pre><code>myView.buildDrawingCache(true);
Bitmap myBitmap = Bitmap.Create(myView.getDrawingCache(true));  
myImageView.setImageBitmap(myBitmap);
myView.destroyDrawingCache();
</code></pre>

<p>Does anyone know how to properly capture and render the drawingCache when anyDensity=false?</p>
