Gradle
implementation("com.jakewharton:butterknife:10.2.1") {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.android.support', module: 'support-compat'
}
annotationProcessor "com.jakewharton:butterknife-compiler:10.2.1"
Situation
When click on these view, there is nothing happened
Solution
1. Make sure call: ButterKnife.bind
Butter Knife doesn’t participate in configuration changes in any way. After rotation onCreateView
is called again, you call ButterKnife.bind
, and it sets a click listener back to your method. Any failure to receive clicks is a disagreement between you and your view hierarchy or perhaps due to multiple fragments overlapping each other.
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_activity);
ButterKnife.bind(this);
// TODO Use fields...
}