views:

96

answers:

2

I want to make a Drawable touchable for a component I am creating, does anyone know how to do that?

final Drawable selected = backgroundSelected;

selected.setBounds(0, 0, 20, 90);
selected.draw(canvas);
canvas.save();
A: 

You cannot do this directly. You need a View to capture touch events.

Romain Guy
Oke, so how can I do this indirectly?
MrThys
A: 

Solved it by using an onTouch event, and then checking the coordinates of the touch against the coordinates of the Drawable.

MrThys