I have an Otto question. I have a Runnable thread that I kick off. It does some processing and posts the result as an event on the bus.
Within the Runnable class, the bus is retrieved by calling the getInstance of this class:
public final class BusProvider {
private static final Bus BUS = new Bus(ThreadEnforcer.MAIN);
public static Bus getInstance() {
return BUS;
}
private BusProvider() {
// No instances.
}
}
Later on, an Activity uses the same method: BusProvider.getInstance() to get access to the bus and register for any events. However, the @Subscribe method is never called:
@Subscribe
public void onGeoCodePosition(GeoCodePosition geoCodePosition) {
.....
}
My assumption is that even though I am forcing the bus to be on a particular thread, ie. ThreadEnforcer.MAIN, because I am spooling up a new thread on the Runnable, the reason that I am not receiving any events later on within the Activity is that the posting in on one thread and the listening is on another and therefore will not work?