Is using event library like Otto or EventBus a recommended way to handle relations between Activities, Fragments, and background threads [closed]

The event bus and Otto are not “recommended ways” by the Android developer guide primarily because they are third party libraries to simplify the task. And I believe Otto is fairly new, so older guides obviously aren’t using it.

I personally like Otto, it’s what I use and I haven’t had any problems with it so far. But of course, that’s because it suited my use-cases.

I have an example on how I used Otto here.

EDIT from the future: if you need an event bus, greenrobot/EventBus is better than Otto. Also, in some cases, LiveData<T> is perfectly sufficient instead of using event bus (which instead of emitting events to anyone, only emits to subscribers).

Leave a Comment