6

In my code I'm listening for events using @Subscribe anotation:

@Subscribe
public void orderUpdate(OrderUpdateEvent event)

My problem is that this method is called multiple times (1-3 depends from run to run) for the same event object.

This is how I send this event:

busProvider.getEventBus().postOnMain(new OrderUpdateEvent();

What could be the cause of that? Do I'm missing something?

4

1 回答 1

6

这可能是什么原因?

一种可能性是,您仍然在事件总线上注册了此类的三个实例。确保您unregister()在该对象不应再收到消息时。

于 2015-01-18T22:49:41.980 回答