Skip to content

Instantly share code, notes, and snippets.

@SeanPONeil
Created August 15, 2012 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeanPONeil/3363033 to your computer and use it in GitHub Desktop.
Save SeanPONeil/3363033 to your computer and use it in GitHub Desktop.
Asynchronous Otto BusProvider that always posts events on the main thread
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