EventBus发消息和处理消息

 

EventBus发消息

1                 WTManagementWTSequenceBean lWTManagementWTSequenceBean = new WTManagementWTSequenceBean();
2                 lWTManagementWTSequenceBean.setSequence(position);
3                 lWTManagementWTSequenceBean.setTicketDownInfoBean(ticketDownInfoBean);
4                 lWTManagementWTSequenceBean.setTicketDownInfoBeans(list);
5                 EventBus.getDefault().post(lWTManagementWTSequenceBean);

 

EventBus处理消息

在一个Activity中

1     @Subscribe
2     public void onEventMainThread(WTManagementWTSequenceBean sequenceBean) {
3         mTicketDownInfoBeans = sequenceBean.getTicketDownInfoBeans();
4 
5         TicketDownInfoBean currentSelectBean = sequenceBean.getTicketDownInfoBean();
6         int intSetSequence = sequenceBean.getSequence();
7         allTypeTickets.set(intSetSequence, currentSelectBean);
8         currentSelectedTicketId = currentSelectBean.getTICKET_ID();
9         currentSelectedTicketNo = currentSelectBean.getTICKET_NO();

 

上一篇:vue项目组件之间的通信方式


下一篇:vue 销毁eventBus