There is a class, such as helper, for the side menu, inside the MaterialDrawer library is used
public class NavigationDrawer { private Drawer drawer; @BindView(R.id.drawer_footer_logo) ImageView footerLogo; @OnClick(R.id.drawer_footer_logo) public void onFooterLogoClick() { close(): if(drawerListener != null) { drawerListener.onFooterLogoClick(); } } public NavigationDrawer(Activity activity) { drawer = new DrawerBuilder() .withActivity(activity) .withHeader(R.layout.drawer_header) .withFooter(R.layout.drawer_footer) //etc.. .build(); ButterKnife.bind(this, drawer.getDrawerLayout()); } public void close() { drawer.close(); } //etc.. } When you click on the logo, nothing happens (the side menu should close). If I change @OnClick to setOnClickListener after ButterKnife.bind , then the application drops to NPE. What's wrong?
ButterKnifeis good for AAA, in MV-like architectures - NO, that’s a living example, IButterKnifeinto a separate class andButterKnifepowerless - Flippy