void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference
<p>Hello can anyone help me solving this problem I don't understand what exactly is wrong and Hello can anyone help me solving this problem I don't understand what exactly is wrong Hello can anyone help me solving this problem I don't understand what exactly is wrong and Hello can anyone help me solving this problem I don't understand what exactly is wrong</p>

<p>MainActivity.java</p>

<pre><code>    public class MainActivity extends AppCompatActivity {

     Button btnSearch,btnDailyEntry,btnNewCust;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btnSearch.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                btnSearch = (Button)findViewById(R.id.btn_search) ;
                Intent intent = new Intent(v.getContext(),Search.class);
                startActivity(intent);
            }
        });
        btnNewCust.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                btnDailyEntry = (Button)findViewById(R.id.btn_daily_entry) ;
                Intent intent = new Intent(v.getContext(),NewCust.class);
                startActivity(intent);
            }
        });
        btnDailyEntry.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                btnNewCust = (Button)findViewById(R.id.btn_new_cust);
                Intent intent = new Intent(v.getContext(),DailyEntry.class);
                startActivity(intent);
            }
        });

    }


}
</code></pre>

<p>activity_main.xml</p>

<pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
    android:orientation="vertical"
    android:gravity="center"&gt;

    &lt;TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Daily Entry System"
        android:textColor="@android:color/holo_blue_dark"
        android:textSize="20dp"/&gt;
    &lt;Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Search"
        android:id="@+id/btn_search" /&gt;


    &lt;Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Daily Entry"
        android:id="@+id/btn_daily_entry" /&gt;

    &lt;Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="New Cust"
        android:id="@+id/btn_new_cust" /&gt;
&lt;/LinearLayout&gt;
</code></pre>