[android-developers] Re: Convert a view (layout) to a Bitmap

2012-11-19 Thread Streets Of Boston
I'm not sure if this will work in your situation, but try calling setWillNotCacheDrawing this on the View 'l' as well: boolean drawsCache = l.willNotCacheDrawing(); l.setWillNotCacheDrawing(false); Bitmap dragPicture = Bitmap.createBitmap(l.getDrawingCache()); l.setWillNotCacheDrawing(drawsCache)

[android-developers] Re: Convert a view (layout) to a Bitmap

2008-11-17 Thread Romain Guy
Hi, If you do this in onCreate(), then the View didn't go through a layout pass yet, so its size is null (0 by 0 pixels.) You need to either wait for the first layout, or force the layout by calling layout() on the View. On Mon, Nov 17, 2008 at 2:34 AM, Jose Cortes <[EMAIL PROTECTED]> wrote: > >