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
2
votes
1 answer

Android - Is it correct to use Event Buses (like Otto) for UI elements communication?

Can I (is it correct to) use an event bus to communicate between UI views? For exemple, use it to communicate between Fragments instead of implementing a listener? Can I use the same instance of the bus for more than one operation? Thank you
gusgol
  • 483
  • 5
  • 11
2
votes
2 answers

Data getting mixed when using Otto in a ViewPager

I am using Otto to get result to a fragment when an http request is made successfully. In my application I have a viewpager. And because the pages are very similar, I use the same fragments in viewpager with different data, to download data. The…
Jithin Sunny
  • 3,352
  • 4
  • 26
  • 42
2
votes
1 answer

Using Otto in place of everything

I've been using Otto event bus for a while and it's been great. Can you think of any disadvantages to using it over a BroadcastReceiver implementation within a package, or over a more traditional interface listener pattern? For example, Google…
SIr Codealot
  • 5,331
  • 9
  • 33
  • 45
2
votes
1 answer

Compare performance of using LocalBroadcastManager and Otto

I'm trying to compare performance of using LocalBroadcastManager and Otto in Android. As I know, Otto is using annotation and Java reflection, so it may have some impacts on performance. Can someone suggest me something to do to measure performance…
congtrungvnit
  • 635
  • 1
  • 10
  • 16
2
votes
1 answer

how to use retrofit with otto and picasso

I want to load data from my API into custom gridview in my android application, my API return some text information and some image URL as JsonArray. I want to use retrofit and otto and picasso (for loading image), also I want asynchronous…
Mohamad MohamadPoor
  • 1,350
  • 2
  • 14
  • 35
2
votes
1 answer

FragmentTransaction in WebViewClient.shouldOverrideUrlLoading throws IllegalStateException

I seem to be fighting with a race condition, the cause of which I can't seem to pin down. When executing the below code, I intermittently get the stack trace below. Is there some obvious rule of the Fragment lifecycle I am disobeying? I am not clear…
2
votes
0 answers

Dagger + Otto architecture guidance

I am trying to develop an app with a somewhat modular architecture (nobody knows about no one, but everybody still can communicate). I will begin with an example: Inside the LoginFragment: @OnClick void login() { bus.post(new…
Egor Neliuba
  • 14,784
  • 7
  • 59
  • 77
2
votes
2 answers

Otto bus event , single subscribe should be called only

I have used otto event bus as explain here. It works great. http://square.github.io/otto/ https://code.google.com/p/guava-libraries/wiki/EventBusExplained Today I realize that if I create event and subscribed it in 2 place, both get called. To more…
morya
  • 835
  • 2
  • 10
  • 19
2
votes
1 answer

Can event bus replace Intents completely in Android application?

Is it possible in Android application to get rid of Intent system completely and use only event bus (Otto, greenrobot)? For example, is it possible to achieve this with event bus only, without Intents at all: Intent i = new Intent(this,…
afrish
  • 3,167
  • 4
  • 30
  • 38
2
votes
1 answer

Disadvantages of using an event bus to update the interface?

I have started to use the event bus library Otto for updating the interface (activities) from different components in my Android application. For instance, when a change to a Model class is made, I post to the event bus or if an AsyncTask has…
Mahoni
  • 7,088
  • 17
  • 58
  • 115
2
votes
2 answers

Does calling register multiple times on the same subscriber results in multiple events calls?

I need Otto to register on onCreate() and also on onResume() Does it result in the same subscriber registered multiple times ? Do I consequently have to call unregister twice ? Thanks
Michael
  • 22,196
  • 33
  • 132
  • 187
2
votes
1 answer

How to callback an Activity in onAttach with Otto?

I am working on an app which uses the NavigationDrawer. Different fragments are placed into the content view of the MainActivity whenever a menu item in the drawer is selected. To inform the MainActivity that a Fragment successfully attached the…
JJD
  • 50,076
  • 60
  • 203
  • 339
2
votes
1 answer

Recommended to use Handler with EventBus/Otto?

With libraries like Otto and EventBus I wonder whether it still makes sense to use Handler: A Handler allows you to send and process Message and Runnable objects associated with a thread's MessageQueue. Each Handler instance is associated with…
Mahoni
  • 7,088
  • 17
  • 58
  • 115
2
votes
1 answer

In OTTO are all instances of a parameterized class the "same"?

I thought I had a nice solution to another question I asked, but now I don't think it will work out. In Otto, if I do something like this: @Subscribe public void foo(ApiRequestEvent event) { } @Subscribe public void bar(ApiRequestEvent
nPn
  • 16,254
  • 9
  • 35
  • 58
2
votes
1 answer

Otto and Volley on orientation

I am integrating both Volley and Otto in a project to handle all service calls and at the same time considering orientation changing. By using Otto i can unregister and re-register the bus on orientation change and then when the Volley returns a…
N Jay
  • 1,774
  • 1
  • 17
  • 36