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

Android GPS track locations to trigger event using Otto library

i want to use the GPS to track locations in the service, once the device is close to some specific locations, post an event and the map fragment can do something based on the event. I thinking about using the Otto event library to do this, But i am…
Aaron Ke
  • 1
  • 1
0
votes
2 answers

Android. Otto Bus doesn't fire event from onActivityResult() method of Fragment to Activity

I have BaseActivity with register() and unregister() methods: public class BaseActivity extends AppCompatActivity{ ... @Override protected void onResume() { super.onResume(); // Register ourselves so that we can provide…
valerybodak
  • 4,195
  • 2
  • 42
  • 53
0
votes
2 answers

Otto Subscribe method not called from Activity to Fragment in Another Activity

This is my first activity where Im making a post call. The bus provider is the default one in the otto sample app. void openNextActivity() { manager.bus.post("Hi"); // Intent to my next Activity } This is my fragment in another activity…
0
votes
1 answer

Dagger 2 + Event bus

I want to send data from the activity to my fragment using otto event bus From my activity: @Produce public EventAvailableEvent produceEvent() { return new EventAvailableEvent(mEvent); } To fragment: @Subscribe public void…
Miguel Fermin
  • 380
  • 1
  • 3
  • 13
0
votes
1 answer

How can i avoid to receive two different events on the same millisecond?

In my app, i have two buttons that send an event with an ID using an event bus (Otto). Depending on this ID, the app goes to a different level of the navigation between differents fragments. Is possible to avoid that the event bus sends the same…
juanjo
  • 87
  • 1
  • 8
0
votes
1 answer

Using Otto Event Bus to pass data between RecyclerViews

I have 2 Recyclerviews inside 2 different Fragments contained in a ViewPager. When a card in my RecyclerviewA is clicked I would like to pass the respective object over to RecyclerviewB currently I have an onClick in RecyclerView with the following…
Andrew
  • 83
  • 7
0
votes
1 answer

How to manage otto registration methods in ViewPager

I am using otto to communicate service and map fragment. In the service, location provider obtains location data sends to map fragment. It works perfectly but i can not manage otto's register and unregister methods with ViewPager . This question…
blackkara
  • 4,900
  • 4
  • 28
  • 58
0
votes
0 answers

Get value from @Subscribe

I have a class where I receive an event - a boolean variable in this case, using EventBus/Otto(for Fragment/Activity or something similar for posibility to subscribe in simple class) like: @Subscribe public void…
Choletski
  • 7,074
  • 6
  • 43
  • 64
0
votes
2 answers

Fragment with recyclerview, refreshing data with otto

I am trying to use Otto for achieving the following use case. I have a Viewpager with Fragments that contains a RecyclerView each. The recyclerviews show posts that the users post to the app. A new post button is attached to each of these…
55597
  • 2,033
  • 1
  • 21
  • 40
0
votes
3 answers

Proper design pattern to grab registration id for GCM push notifications?

I have an activity that call an Otto Event called LoadAuthenticateEvent this event then goes to my ClientManager.java where the following code is: @Subscribe public void onLoadAuthenticateEvent(LoadAuthenticateEvent loadAuthenticateEvent) { //…
AndyRoid
  • 5,062
  • 8
  • 38
  • 73
0
votes
1 answer

Where is the event object created in a message producer in Otto?

Following the code example for Otto, when an event is produced, an event class is returned from the producer function: @Produce public AnswerAvailableEvent produceAnswer() { // Assuming 'lastAnswer' exists. return new…
Zerp
  • 874
  • 2
  • 8
  • 18
0
votes
1 answer

Error when receiving a response from the server

I am have problem with ott+activity+fragment. 1. I am open Activity and register otto in onCreate. Observer.getInstance().register(this); 2. I am send request to the server if my method finished @Override public void didScanBarcode(String…
Pavel Petrashov
  • 257
  • 1
  • 4
  • 13
0
votes
2 answers

how to correctly extends the class from the library Otto?

I am use Otto library in my project. And me need any functionality from this library wherein not.I want to do so: Bus.post(MessageType.USER_SIGN_UP_SUCCESS, user); and in my method realise do so: @Subscribe({MessageType.USER_LOGGED_IN_SUCCESS,…
0
votes
2 answers

Otto event Bus loop / time events

Is there build in way with square otto to send events in a loop or to time events? Or do I have to handle firing events in a loop myself?
Fabian
  • 2,693
  • 2
  • 21
  • 33
0
votes
1 answer

Otto. Avoid @Produce validation warnimg message

Android Otto library gives below warning message when @Produce method is used. How to avoid the message? Note: Validating elements C:\Users\Me\GroupViewActivity_.java:90: warning: Element ProduceHandler unvalidated by public GroupViewEvent…
Youngjae
  • 24,352
  • 18
  • 113
  • 198