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
58
votes
7 answers

How to send event from Service to Activity with Otto event bus?

Simple BusProvider.getInstance().post() bring exception not main thread. How to send event from Service to Activity with Otto event bus?
Mecid
  • 4,491
  • 6
  • 30
  • 30
47
votes
4 answers

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

In most of the case, when dealing with case User thread (AsyncTask) to perform background processing Pass back calculated result back to Activity or Fragment Activity or Fragment re-creation might happen before user thread finishes its background…
Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875
45
votes
3 answers

Otto vs LocalBroadcast:

I am a huge fan of open source contributions square has done to the Android community and was looking into their latest contribution Otto (event bus ) http://square.github.io/otto/ Digging deeper I see that Otto uses reflection and there is no…
Chris
  • 798
  • 1
  • 9
  • 15
25
votes
1 answer

Using Intents or an event bus to communicate within the same app

I understand how to use Intents to communicate with the system/other apps. I understand how to use Intents within the same App. I also understand how to use Otto to communicate within the same App. What are the Pro/Cons of using Otto vs. Intents to…
Martin S.
  • 556
  • 4
  • 11
24
votes
4 answers

Which Activity lifecycle methods are best to register/unregister to event bus?

What is the best place to register and unregister to an event bus (like otto, EventBus, or tinybus) in an Activity and why? onCreate()-onDestroy() onStart()-onStop() onResume()-onPause() Otto's example uses onResume()-onPause(), EventBus's…
levavare
  • 494
  • 1
  • 4
  • 13
20
votes
4 answers

ClassNotFoundException: Didn't find class "android.os.PersistableBundle" Otto Android 5.0

I have a strange issue. I have an app which I deployed on an Android 4.4 device and use Otto library. I deployed the app on an Android 5.0 device. It still works. I retried on the 4.4 and the app won't launched. Apparently, it tries to use…
Cocorico
  • 1,998
  • 1
  • 22
  • 38
16
votes
2 answers

RuntimeException: Could not dispatch event @ otto

we have an issue in our current app-version with the EventHandler from otto. We get a RuntimeException in our crash-log, with following description: "Reason: java.lang.RuntimeException: Could not dispatch event: …
iFoukis
  • 274
  • 1
  • 2
  • 11
14
votes
3 answers

Best Practices for Handling Search

I've got a SearchView setup, and I have a loosely decoupled architecture using Retrofit and Otto. I am wondering what the Best Practices are for Search in Android, or any mobile application in general (meaning something like this could be applied to…
AndyRoid
  • 5,062
  • 8
  • 38
  • 73
14
votes
4 answers

Otto/EventBus across multiple processes

Is it possible to post event in one process (for example inside SyncAdapter which has android:process=":sync" manifest attribute) and receive it in another (inside regular app UI) with Otto or EventBus? I know that Intent and BroadcastReceiver work…
svenkapudija
  • 5,128
  • 14
  • 68
  • 96
14
votes
1 answer

IllegalArgumentException with Otto Event bus in Fragment instance

I am using Otto Event bus to subscribe to certain events in a ListFragment. The bus instance is stored and created in an subclass of Application, in other words, it bus should work as a singleton. It seems like this is not a case... The fragment is…
7
votes
1 answer

Advantages of injecting Otto event bus instead of using static singleton

In my Android apps i'm using Otto as event bus and Dagger for dependency injection. In the userguide of Otto and in many blog posts it's recommended to use injection to get a bus singleton. I have done that for some time, but lately i'm getting more…
7
votes
4 answers

IllegalArgumentException when using Otto with a retained Fragment

I am using Otto 1.3.3 and when I resume my application sometimes I get an IllegalArgumentException with the following stacktrace: Caused by: java.lang.IllegalArgumentException: Producer method for type class com.couchsurfing.mobile.ui.setup …
Niqo
  • 1,072
  • 10
  • 20
7
votes
3 answers

OTTO and Fragments in other Activitys

i started using OTTO by Square yesterday, so far i had a good start. Otto works great out of the Box when you have your Fragments already hosted in an FragmentActivity and you just need communicate between Fragment hosted by that…
Kitesurfer
  • 3,438
  • 2
  • 29
  • 47
6
votes
2 answers

java.lang. RuntimeException No Retrofit annotation found. (parameter #3)

I'm trying to update this RetroFit + Otto tutorial, so my code updated is: IWeather.java RetroFit 2.+ doesn't allow to return void, so instead of void getWeather(...) I added Call getWeather(...). public interface IWeather { …
Óscar
  • 1,143
  • 1
  • 19
  • 38
6
votes
2 answers

RxAndroid, event bus and Activity lifecycle

I found a few articles talking about how RxJava/RxAndroid can replace event busses (such as…
dors
  • 5,802
  • 8
  • 45
  • 71
1
2 3
12 13