Basing on the RoboGuice API for firing an event, inside my CustomButtonView implementation I have did like so:
@Override
public void onClick(View v) {
CommonApplication.getInstance().fireEvent(new InteractionButtonClicked());
// setSelected();
}
public class InteractionButtonClicked
{
public String getRef()
{
return (String)getTag();
}
}
// handle the click event
protected void handleClick(@Observes InteractionButtonClicked button) {
if (getTag().equals(button.getRef())) {
//do A
} else {
//do B
}
}
However, handleClick does not get called in this context=> when I set an @Observer in the main activity it's containing method does get called.
I'm trying to understand why, and if there is an option to observe the event in the Customview context...