标签:class pac template void gre ack nbsp eventbus sub
implementation ‘org.greenrobot:eventbus:3.2.0‘
EventBus
package com.qiqi.app.bean; public class EventMessageWrap { public final String message; public static EventMessageWrap getInstance(String message) { return new EventMessageWrap(message); } private EventMessageWrap(String message) { this.message = message; } }
发送fragment:
EventBus.getDefault().post(EventMessageWrap.getInstance("1"));
接收fragment:
EventBus.getDefault().register(this);
EventBus.getDefault().unregister(this);
@Subscribe(threadMode = ThreadMode.MAIN) public void onGetMessage(EventMessageWrap message) { getBannerData(); getTemplateClassification(); }
标签:class pac template void gre ack nbsp eventbus sub
原文地址:https://www.cnblogs.com/pengmn/p/14938664.html