I’ve got a View defined with 3-4 items on it (buttons, ImageView, etc.). The View has an onLongClickListener defined:
view.setOnLongClickListener(new OnLongClickListener() { ... }
As long as I long click on an empty portion of my view, this works great — but if I long click on my image, for example, the long click doesn’t get triggered.
Is there anyway in Android to make the child elements “pass up” their events without needing to define an onLongClick listener for each element?
I don’t think you can do it without overriding it in a custom class or creating a listener to pass it up. You could define a single instance of an OnLongClickListener that you pass to all of them that does something like
or