Skip to content

Latest commit

 

History

History
2 lines (2 loc) · 688 Bytes

File metadata and controls

2 lines (2 loc) · 688 Bytes

BaseActivityAndFragmentWithButterKnife

This little piece of code aims to show you how to use 'ButterKnife' inside both base activity and it's fragments. The challenge was to use binding annotations of ButterKnife inside the base activity which has an empty layout at first sight. We inflated a template layout to the base activity inside the onCreate method . The second mission was to reuse @BindView annotation for inflated instance of a fragment inside the base activity. This solution provides less java codes inside activities. The activity now only takes care of filling the content with some fragment instances. No license needed. The code can be used and distributed freely.