Search in sources :

Example 1 with EventBus

use of org.greenrobot.eventbus.EventBus in project EventBus by greenrobot.

the class ErrorDialogFragments method handleOnClick.

public static void handleOnClick(DialogInterface dialog, int which, Activity activity, Bundle arguments) {
    if (EVENT_TYPE_ON_CLICK != null) {
        Object event;
        try {
            event = EVENT_TYPE_ON_CLICK.newInstance();
        } catch (Exception e) {
            throw new RuntimeException("Event cannot be constructed", e);
        }
        EventBus eventBus = ErrorDialogManager.factory.config.getEventBus();
        eventBus.post(event);
    }
    boolean finish = arguments.getBoolean(ErrorDialogManager.KEY_FINISH_AFTER_DIALOG, false);
    if (finish && activity != null) {
        activity.finish();
    }
}
Also used : EventBus(org.greenrobot.eventbus.EventBus)

Example 2 with EventBus

use of org.greenrobot.eventbus.EventBus in project EventBus by greenrobot.

the class TestRunnerActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_runtests);
    textViewResult = (TextView) findViewById(R.id.textViewResult);
    controlBus = new EventBus();
    controlBus.register(this);
}
Also used : EventBus(org.greenrobot.eventbus.EventBus)

Example 3 with EventBus

use of org.greenrobot.eventbus.EventBus in project EventBus by greenrobot.

the class AbstractEventBusTest method setUpBase.

@Before
public void setUpBase() throws Exception {
    EventBus.clearCaches();
    eventBus = new EventBus();
    mainPoster = new EventPostHandler(Looper.getMainLooper());
    assertFalse(Looper.getMainLooper().getThread().equals(Thread.currentThread()));
}
Also used : EventBus(org.greenrobot.eventbus.EventBus) Before(org.junit.Before)

Aggregations

EventBus (org.greenrobot.eventbus.EventBus)3 Before (org.junit.Before)1