android - Square's Otto and Threads -


i have otto question. have runnable thread kick off. processing , posts result event on bus.

within runnable class, bus retrieved calling getinstance of 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, activity uses same method: busprovider.getinstance() access bus , register events. however, @subscribe method never called:

@subscribe public void ongeocodeposition(geocodeposition geocodeposition) {     ..... } 

my assumption though forcing bus on particular thread, ie. threadenforcer.main, because spooling new thread on runnable, reason not receiving events later on within activity posting in on 1 thread , listening on , therefore not work?

you should use threadenforcer.any


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -