Hello everyone. In my app I need to draw a widget contents onto Bitmap.
The code(pseudo) is as follows:
AppWidgetHostView widget;
Bitmap bitmap;
...
widget = pickWidget();
...
bitmap = Bitmap.createBitmap(128, 128, Bitmap.Config.RGB_565);
final Canvas canvas = new Canvas(bitmap);
widget.draw(canvas);
I'm sure that pickWidget() works ok - if do setContentView(widget); I get the widget displayed properly on full screen. Bitmap I'm drawing to also displays ok - if I draw on a canvas using drawCircle or do setPixel() on the Bitmap for example I can see the drawings. So the issue is with widget.draw(), it doesn't seem to have any effect on the bitmap. Please share your thoughts.