80,351
社区成员
发帖
与我相关
我的任务
分享
protecte void onCreate(@Nullable Bundle savedInstanceState) {
EventBus.getDefault().register(this);
}
protected void onDestroy() {
EventBus.getDefault().unregister(this);
super.onDestroy();
}
@Subscribe
public void onTe(MotionEvent ev) {
dispatchTouchEvent(ev);
Utils.toastInstance("ev分发");
}
他上面的Activity
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
EventBus.getDefault().post(ev);
return true;
}
没有任何问题,所有事件全部传到mainActivity了