赞
踩
这个问题的答案恐怕一般都是在某个响应方法上加@Subscribe注解,我看了一百遍还是加了,还是没解决问题,后来终于机缘巧合下被我发现了事情的真相
这是我的BaseFragment部分代码:
@Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { view = View.inflate(getContext(), getContentViewLayoutId(), null); unbinder = ButterKnife.bind(this, view); initViewsAndEvents(); return view; }
protected abstract int getContentViewLayoutId(); protected abstract void initViewsAndEvents();
我错在不小心把register方法写在getContentViewLayoutId()方法中了,应该写在initViewAndEvents()方法中,以后我可千万注意不在getContentViewLayoutId方法中乱写了。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。