I have a listening method that waits for a FooBarEvent
in the Dummy
class:
@Subscribe
public void testingEvents(FooBarEvent event) {
}
On the other hand, I have a class that needs that method :
public class TestEvents{
public TestEvents(event){
FooBarEvent event = new FooBarEvent (...);
event.post(event);
}
}
This is called from the main class which acts like this :
EventBus bus = new EventBus();
bus.register(new Dummy());
The question is : How can get, at the testingEvents
(the subscriber), the class that posted the events?.
(As a result, I'm expecting to get at that method that the caller is the TestEvents
class).
Thank you.