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

Guava/Otto EventBus with null references

Suppose the following scenario with classes A,B and an instance of a event bus (It can be the Guava event bus, by Google or the Otto event bus, by Squ.re) class A{ @Subscribe public void onSomething(B event){ //do something …
fernandohur
  • 7,014
  • 11
  • 48
  • 86
2
votes
5 answers

Communicative Between Fragments on Android

I am attempting to build an Android application that has two tabs, one for a textField/button and TreeMenu (where each element has a checkbox associated with it) and another for a list. I am also using an ActionBarSherlock. I have already…
NumenorForLife
  • 1,736
  • 8
  • 27
  • 55
1
vote
1 answer

Why my new fragment can't subscribe otto

I have made a post in my activity, and it works well in the first fragment BlankFragment, however, when I tried to replace BlankFragment with BlackFragment2, and do the same subscribe, it can't subscribe anymore, here is the code. MainActivity: …
Zhengzhi Zhou
  • 21
  • 1
  • 3
1
vote
1 answer

Otto event bus not fired from an activity to another activity with fragments

I am not new to using event bus but I got strange behavior in the following scenario: I have MainActivity which have two fragments that need to update their contents using Otto event bus from SecondActivity which launched from MainActivity. The…
blueware
  • 5,205
  • 1
  • 40
  • 60
1
vote
1 answer

what to use or how best to convert otto event bus (now that otto is deprecated)?

on Square's github i found the following statement: Deprecated! This project is deprecated in favor of RxJava and RxAndroid. These projects permit the same event-driven programming model as Otto, but they’re more capable and offer better…
j2emanue
  • 60,549
  • 65
  • 286
  • 456
1
vote
1 answer

Using Ottos bus for 'notification polling'

On all my views I have an icon that will have a red dot if the user has notifications, so I created a class to constantly (every few minutes) poll and see if they have notifications. Except the @Subscrtibe is never getting triggered. One thing that…
John
  • 1,808
  • 7
  • 28
  • 57
1
vote
1 answer

I can't use any method inside subscribe method otto

My app show fragment(1). After that user choose one of another fragments(2-10) for press button. After that, fragment(2-10) send data to activity and open activity -that works well-. Finally, activity edit the data and send it to fragment(1) -here…
1
vote
2 answers

Otto event bus runtime subscription for events

Is it possible in Otto to subscribe to events without using @Subscribe annotation ? In my use case I do not know to which event my object should subscribe to at compile time. I wish to do it at runtime based on certain rules.
Abhishek Bansal
  • 5,197
  • 4
  • 40
  • 69
1
vote
2 answers

Update One Item in RecyclerViewAdapter with Otto

I am using the DownloadManager to download files and would like to update a progress view in a RecyclerView.ViewHolder for each download. My current idea is to use Otto to post a downloadProgressed event. I would like my viewHolders to register in…
Hackmodford
  • 3,901
  • 4
  • 35
  • 78
1
vote
1 answer

ConversionException with Retrofit and Gson

I am working with Retrofit and Gson Converter but I get this weird Exception. I am using two URLs to perform the call. In both cases I do the same call and get the same response in the full-log level, but one of the URLs gives me this Exception and…
1
vote
1 answer

Otto - Produce vs Publish

Can someone give me a use case of Produce? I don't quite understand its purpose as I have been exclusively using Publish. Is the only difference is that with Produce it will send a callback immediately when a class subscribes to the bus? So you can…
Alan
  • 9,331
  • 14
  • 52
  • 97
1
vote
1 answer

Is it the proper way to use an event bus?

I am planning to add Otto event bus to decouple my communications. One of the things I want use event bus for is to communicate between a button click handler and the activity. The idea is that the button click (from my custom view) would generate…
An SO User
  • 24,612
  • 35
  • 133
  • 221
1
vote
1 answer

Thread enforcement per method with Otto

I'm using Otto as my event bus in my android application. I had to make sure that certain events are called in the main thread, or not in the main thread, for that I created my own bus class which uses Otto like so: class MyEventBus { private…
Nitzan Tomer
  • 155,636
  • 47
  • 315
  • 299
1
vote
0 answers

Otto Event Bus obsolete event detection

Let's say the following sequence of operation happens. Activity A starts Long delay network call ReqA made Before ReqA completes switch to Activity B Quickly switch back to Activity A Same call ReqB is made (ReqA not complete yet) Somehow ReqB…
dumb_terminal
  • 1,815
  • 1
  • 16
  • 27
1
vote
1 answer

RxAndroid & Otto Wait for multiple async events to send data to server

I have an Android app in which I need to register to GCM , ask the user for facebook authorization and get the token, have the user fill a form and so on... Once that's all done I want to send all of that info to my server. I was wondering if there…
user47376
  • 2,263
  • 3
  • 21
  • 26