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();
}
}
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);
}
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()));
}