FAQ Database Discussion Community


Android Event bus does not works with two event listener

android,greenrobot-eventbus
In my Android application I have used an Activity and Adapter for list view, my acquirement is need to communicate both adapter class and activity via event listener using EventBus, so that I have created two event listener classes. My process is: 1) I have a button in the activity,the...

EventBus Not on the main thread

android,google-maps,android-fragments,greenrobot-eventbus
I'm trying to get the positions from my WS and update my markers in my GoogleMap fragment so what i'am doing is: I've my HomeActivity wich contains 2 fragments (2 GoogleMaps where one have TileOverlay). In my GoogleMap fragment i'am trying to obtain my Markers Positions from OnCameraChangeListener so the...

Sticky events should remain after app close GreenRobot Eventbus

android,greenrobot-eventbus
Using StickyEvents from GreenRobot - EventBus they donĀ“t stay in memory after I close the app (showing the running apps and then slide to remove it from there) or after I run a new build from Android Studio. I mean onEventMainThread is not called after EventBus.getDefault().registerSticky(subscriber); Why?...

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

android,android-asynctask,event-bus,otto,greenrobot-eventbus
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 processing So far, from many reliable sources, I can see the recommended way...

Difficulty in understanding complex multi threading in Android app

java,android,multithreading,android-graphview,greenrobot-eventbus
I have big problem with understanding multi threading in my application and because of that finding a bug. I've checked I think all possibilities and still I am getting various (sometimes unexpected) errors. Maybe someone here will be able to advice me, what I should do. In my project I...

Subscriber class android.app.Application has no public methods called onEvent

android,greenrobot-eventbus
I have delegated some of my Views from Activity to a class named BottomBar. What I want is when I the back button to send an event to the BottomBar so an animation starts to play. @Override public void onBackPressed() { if (isSubMenuDisplayed) { isSubMenuDisplayed = false; EventBus.getDefault().post(new EventStartReverseAnimation(true)); //post...

AndroidAnnotations and EventBus

android,android-annotations,greenrobot-eventbus
I have an annotated Activity in a library, which is a subscriber to an EventBus event from the same library. It looks something like this, greatly simplified: @EActivity(resName = "activity_foo") public class Foo extends Activity { public void onEvent(BarEvent event){ doSomething(); } } It should work according to this: http://timnew.me/blog/2014/09/14/otto-and-android-annotations-compatibility-issue-analysis/...