Subscriber not getting fired when using Otto

可紊 提交于 2019-12-04 12:15:46

Make sure you are importing "com.squareup.otto.Subscribe" not "com.google.common.eventbus.Subscribe"

The example code works without any issues independently. The reason i was facing this problem initially (as was rightly pointed out by @powerj1984): There was a misconfiguration in my project, where the bus that was being injected (via Dagger) was different from the bus instance that was being subscribed to for updates :P.

Lesson learnt: make sure the bus you use, is the same instance in both cases.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!