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

 

posted @ 2021-09-11 11:46  杨斌_济南  阅读(126)  评论(0编辑  收藏  举报