Questions tagged [otto]

Otto is an event bus designed to decouple different parts of your application while still allowing them to communicate efficiently. It is designed with Android-specific use cases in mind.

Otto is an event bus designed to decouple different parts of your application while still allowing them to communicate efficiently. It is designed with Android-specific use cases in mind.

Forked from Guava, Otto adds unique functionality to an already refined event bus as well as specializing it to the Android platform.

186 questions
6
votes
4 answers

Otto event no firing

I have an activity and it launches a DialogFragment, on completion of an event the DialogFragment posts an event on the Otto Event Bus, this is to fire a method in it's parent activity. I've posted the related code here, the same code is working…
Giridhar Karnik
  • 2,213
  • 4
  • 27
  • 47
6
votes
1 answer

Reducing number of event classes when using EventBus or Otto

I am about to start development on an Android app. I am interested in using Otto or EventBus in my app to assist with making asynchronous REST network calls and notifying the main thread when the calls have returned.The one major flaw with the use…
6
votes
1 answer

NullPointerException with Otto and Dagger

I'm new to Otto and I'm having serious trouble making out its functioning together with Dagger dependency injector and JobManager. Whenever I launch my application, I keep getting the same error message: "java.lang.RuntimeException: Unable to…
Juan José Melero Gómez
  • 2,742
  • 2
  • 19
  • 36
6
votes
1 answer

@Subscribe method called multiple time for the same event

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…
skywalker
  • 318
  • 4
  • 10
6
votes
1 answer

otto eventbus for android behaves differently in release build

i have a singleton service class that pulls data from a server on a set schedule. as soon as the client has received the data, i trigger bus.post(new NewServerResponseEvent()); (http://square.github.io/otto/) then in my fragments i do…
stephanlindauer
  • 1,910
  • 2
  • 14
  • 17
6
votes
3 answers

Are there any advantages to switch to Otto from Broadcast events

I stumbled upon Otto, and it looks like it's used as a replacement for Broadcast events. I read the doc but, I don't understand if there are much advantages to use Otto.
5
votes
2 answers

Can I register an Otto bus on both base and child class?

I'm using Otto event bus in my Android app. I've read the GitHub documentation and various questions posted online about how hierarchy traverse is working: "Registering will only find methods on the immediate class type. Unlike the Guava event bus,…
Lou Morda
  • 5,078
  • 2
  • 44
  • 49
5
votes
1 answer

Using Otto to refresh a listadapter from a GcmListenerService

I'm using Otto to refresh a buddies list when a buddy debuddies me. I'm having issues updating the UI from a non-main thread, so I looked into it and 'solved' the issue using this post. The code they use is this: public class BusProvider extends…
Brandon
  • 1,886
  • 2
  • 17
  • 28
5
votes
1 answer

Unregistering listeners in onDestroy - what's the harm / can they leak?

I'm trying to understand if there is any potential harm on waiting until onDestroy to unregister a listener. I'm specifically referring to unsubscribing from an eventbus (otto), but believe that the answer applies to most listener pattern…
Kyle Ivey
  • 5,992
  • 1
  • 23
  • 35
5
votes
2 answers

Issue Subscribing to/Receiving Otto Event Posted from IntentService

I seem to be having one of two issues here. Either an error like: java.lang.IllegalStateException: Event bus [Bus "default"] accessed from non-main thread Looper Or, if I've managed to "address" that, I simply never receive the event in my…
Michael
  • 4,010
  • 4
  • 28
  • 49
4
votes
1 answer

Android Event Bus Alternative

Context: In a previous Android application I have developed, I used an event bus (otto by Square) to handle async task results (for example: the result of a server request is posted on the bus and somewhere in the application I intercept that…
Ionut Ciuta
  • 618
  • 1
  • 9
  • 24
4
votes
5 answers

Otto throw "Object already registered" onResume in viewpager

I have 2 fragments in viewpager. When application is paused (press home button, or below other application) and then resumed, otto throw E/stack: task on pause E/stack: note on pause E/stack: onPause E/stack: onResume E/stack: task on resume …
Yarh
  • 4,459
  • 5
  • 45
  • 95
4
votes
1 answer

Leakcanary report of memory leak using Otto

Following up on my last question, here is the second memory leak I can not get rid of.. I read that I need to register and unregister my static Otto bus according to the Activity and Fragment lifecycle, so I added the register and unregister calls…
sickmartian
  • 133
  • 3
  • 11
4
votes
2 answers

Model View Presenter with an EventBus, how to get Events back to Presenter?

I am using the Model-View-Presenter design pattern coupled with an EventBus (Otto). The entire reason I implemented this pattern is to decouple events to the presenter only, and have the presenter update the views. This is an example of some of the…
AndyRoid
  • 5,062
  • 8
  • 38
  • 73
4
votes
2 answers

RecyclerView leaks on recreate

My RecyclerView is creating a memory leak each time that its activity has been recreated. I have google it but i was able to find any solution to that. The activity is being destroyed with the back button and its being creating when into to a button…
kokeroulis
  • 115
  • 1
  • 8
1
2
3
12 13