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
1
vote
2 answers

Using Otto for communication between threads: Can it cause any problems?

I've tried out Otto in my latest Android project, and it really does simplify communication between Objects a ton. However, I'm not certain if there can be any hidden problems from communicating between Threads with it. This is what I did, created a…
EpicPandaForce
  • 79,669
  • 27
  • 256
  • 428
1
vote
1 answer

How to use Otto event bus with Android Annotations

I am working on an app where I want to use Android Annotations and Otto Bus Event from Square For the integration of these two libraries together I have followed this link here. Also I have used the Otto 2.0-wip lib that is suggested there and not…
Ultimo_m
  • 4,724
  • 4
  • 38
  • 60
1
vote
0 answers

Getting responses to specific events with Otto

I have a two stage process where I upload images, get an image id, then attach that id to a post and create a post on a server. I'm using Otto, Tape, and Retrofit to handle the nuts of bolts of this, most of which is going well already. I can…
jmickela
  • 663
  • 1
  • 8
  • 17
1
vote
1 answer

It's not possible to produce and subscribe to events using Otto?

I'm trying to Subscribe and Post from the same fragment, but I'm getting this error when i try to register the fragment: ...(my method) has @Produce annotation but requires 1 arguments. Methods must require zero arguments. on …
Motheus
  • 533
  • 5
  • 21
1
vote
1 answer

Get object annotated with Qualifier from Dagger graph

Unless a singleton object in graph is annotated with a Qualifier we can just call: graph.get(Bus.class); If this object is annotated in the module definition with a Qualifier then it will throw IllegalStateException. Is there a better way of…
gswierczynski
  • 3,813
  • 2
  • 21
  • 22
1
vote
1 answer

Otto - post a message between activity lifecycle

I'm studying a way to handle activity lifecycle and retain the state/progress of users app, then I found the otto/eventbus solution. But after some research i can't figure out how to handle a particular case. So, what happens if my worker thread…
Cedulio Cezar
  • 288
  • 3
  • 10
1
vote
1 answer

Otto Event Bus Subscriber of finished activity

When I start a new activity in a fragment like this Intent launchIntent = new Intent(); launchIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); …
Sven Mäurer
  • 715
  • 1
  • 9
  • 19
1
vote
0 answers

Square Retrofit + Otto with Robolectric Unit Tests

I've a setup with Square Retrofit + Otto. On API call success or failure Otto notifies the subscribing object. I'm trying to write unit tests without mocking request/response. But I don't seem to get any response or even…
dinidu
  • 183
  • 1
  • 6
1
vote
0 answers

Otto bus and ViewPager registering multiple times

I have application with menu drawer. One of the menu options, change main container to ViewPager. In ViewPager, I have fragment which subsribes to Otto Event Bus (in onResume() method). On first click, onResume() method in ViewPager is called, then…
Bresiu
  • 2,123
  • 2
  • 19
  • 31
1
vote
1 answer

Dynamic data exchange between child fragments

There is an Activity which has fragments and their child fragments. A dynamically produced string array needs to be exchanged in between two of child fragments. But, whatever I've used techniques for that, it returned null everytime. I also used…
1
vote
0 answers

How to create worker process using Otto and Dagger?

I want to do some work when certain event happened. To solve this problem using Android SDK I can create BroadcastReceiver that will start IntentService that will do the job. Instead of using Android classes I want use normal Java classes to do the…
Alexey Zakharov
  • 24,694
  • 42
  • 126
  • 197
1
vote
1 answer

Using subscribe on event in FragmentDialog

I using FragmentDialog for subscribe on events using otto library. @Subscribe public void onPickupRequestResponse (PassengerPickupRequestResponseEvent event){ Toast.makeText(this.getActivity().getApplicationContext(), "Event handled",…
Oksana
  • 13,442
  • 10
  • 53
  • 89
1
vote
1 answer

Testing Android Activity with Robolectric, duplicated Otto provider

I have a little problem figuring out how to test my Activity using Robolectric 2.2. I am probably not correctly setting up the lifecycle or the entire test... In my Activity, I have a Otto producer like this: @Produce public GetAlarmList…
Andrea Richiardi
  • 703
  • 6
  • 21
1
vote
1 answer

Is it OK to use Otto event bus bidirectionally?

Is it good practice to use Otto event bus bi-directionally? I mean, send events from controller to view, and view to controller? Or is it just meant to publish results meaning its purpose is only events from controller to view? Thanks
oxygenpt
  • 368
  • 2
  • 17
1
vote
1 answer

Synchronize ListFragment and SupportMapFragment selection

I have 2 views of essentially the same data: List of items in a android.support.v4.app.ListFragment Markers on a map in a com.google.android.gms.maps.SupportMapFragment Both of the above are using loader pattern to obtain the same data (extending…