Created
August 15, 2012 19:47
-
-
Save SeanPONeil/3363033 to your computer and use it in GitHub Desktop.
Asynchronous Otto BusProvider that always posts events on the main thread
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AsyncBus extends Bus { | |
private final Handler mainThread = new Handler(Looper.getMainLooper()); | |
@Override public void post(final Object event) { | |
mainThread.post(new Runnable() { | |
@Override public void run() { | |
AsyncBus.super.post(event); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment