场景:在Android里,有一个Adapter,Activity里用Eventbus来post数据到这个adapter里。
问题:我可以在Adapter的构造方法里调用register()方法:
public BroadcastAdapter(Context context) {
mContext = context;
EventBus.getDefault().register(this);
Log.d(TAG, "constructor");
}
但我要在哪里调用EventBus.getDefault().unregister(this)呢?
哔哔one
相关分类