Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import android.os.Handler;
import android.os.Looper;
import com.squareup.otto.Bus;
public class MainThreadBus extends Bus {
private final Handler mainThread = new Handler(Looper.getMainLooper());
@Override public void post(final Object event) {
if (Looper.myLooper() == Looper.getMainLooper()) {;
} else { Runnable() {
public void run() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment