Butterknife is mostly used for moving one activity to another activity.In Butterknife  we use dependency for moving one Activity to another activity. For example you have two activities then we go from First activity to Second activity then we use butterknife in android see the example below.

Grad Build File: – First add dependency

compile ‘com.jakewharton:butterknife:7.0.1’

First XML file name: – activity_main.xml

<?xml version=”1.0″ encoding=”utf-8″?>
<RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android”
xmlns:app=”http://schemas.android.com/apk/res-auto”
xmlns:tools=”http://schemas.android.com/tools”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:orientation=”vertical”
tools:context=”jeevan.karan.butterknife.MainActivity”>

<TextView
android:id=”@+id/textview”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”Hello World!” />

<Button
android:id=”@+id/button”
android:layout_width=”wrap_content”
android:gravity=”center”
android:textSize=”16dp”
android:layout_centerInParent=”true”
android:textColor=”#ffffff”
android:background=”@color/colorAccent”
android:layout_height=”wrap_content”
android:text=”Button” />
</RelativeLayout>

2nd XML file name: – activity_main2.xml

<?xml version=”1.0″ encoding=”utf-8″?>
<RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android”
xmlns:app=”http://schemas.android.com/apk/res-auto”
xmlns:tools=”http://schemas.android.com/tools”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
tools:context=”jeevan.karan.butterknife.Main2Activity”>
<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_centerInParent=”true”
android:gravity=”center”
android:textSize=”30dp”
android:text=”Welcome to www.javatpoint.info”/>
</RelativeLayout>

1st Java file name: – MainActivity.java

package jeevan.karan.butterknife;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class MainActivity extends AppCompatActivity {
TextView title;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
}
@OnClick(R.id.button)
public void submit()
{
Intent intent = new Intent(this,Main2Activity.class);
startActivity(intent);
}
}

2nd Java file name: – Main2Activity.java

package jeevan.karan.butterknife;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class Main2Activity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
}
}