Egek92 Egek92 - 1 year ago 73
Android Question

@OnClick on Butterknife doesn't work

There is no error in code or gradle build but when I click to button, nothing happens

@BindView( Button bWakeup;

protected void onCreate(Bundle savedInstanceState) {


public void wakeButtonClick(View v) {
Intent intent = new Intent(MainActivity.this, SetTimeActivity.class);
intent.putExtra(MODE, WAKEUP);

Answer Source

I Followed below steps and its working fine for me.

Configure your project-level build.gradle to include the 'android-apt' plugin:

buildscript {
   repositories {
   dependencies {
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

apply the 'android-apt' plugin in your module-level build.gradle and add the Butter Knife dependencies:

Apply plugin: 'android-apt'

android {

dependencies {
  compile 'com.jakewharton:butterknife:8.2.1'
  apt 'com.jakewharton:butterknife-compiler:8.2.1'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download