I\'m working with Android 2.1 and have the following problem: Using the method View.getDrawingCache() always returns null. getDrawingCache() should return a Bitmap, which is
Bitmap screenshot; view.setDrawingCacheEnabled(true); screenshot = Bitmap.createBitmap(view.getDrawingCache()); view.setDrawingCacheEnabled(false);
You need Bitmap.createBitmap(view.getDrawingCache()); as the Bitmap from which the reference is received by getDrawingCache() gets recycled.
Bitmap.createBitmap(view.getDrawingCache());
getDrawingCache()