其他分享
首页 > 其他分享> > EventBus发消息和处理消息

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

 

标签:处理,sequenceBean,lWTManagementWTSequenceBean,currentSelectBean,WTManagementWTSequ
来源: https://www.cnblogs.com/YangBinChina/p/15254217.html