I want to load e.g. LinearLayout with some Buttons from xml and draw it on Canvas in a way that the Views behave normally (I can set onClick actions for the Buttons and when I press a Button, it changes it's background drawable). Can I do this?
A:
Try to convert your View in a Bitmap and create a Canvas based on your Bitmap like here.
Andrei Bularca
2010-09-28 13:01:21
I tried something similar (I just simply called View.draw() method), but when user clicks on the Button, I send the motion event to the root view, but the Button doesn't change it's background drawable.
fhucho
2010-09-28 13:08:37