title: Actionbarsherlock custom layout clickable imageview
body: <p>I am trying to make my imageview that is defined in my custom layout for Actionbarsherlock clickable. My activity first sets a layout:</p>
  
  <pre><code>setContentView(R.layout.myLayout);
  </code></pre>
  
  <p>The actionbar_layout is set in the same activity like this:</p>
  
  <pre><code>View cView = getLayoutInflater().inflate(R.layout.actionbar_layout,
              null);
      actionBar.setCustomView(cView);
  </code></pre>
  
  <p>The actual actionbar_layout looks like this:</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="wrap_content"
  android:layout_height="wrap_content"
  android:layout_gravity="left"
  android:orientation="horizontal" &gt;
  
  &lt;ImageView
      android:id="@+id/actionBarLogo"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center_vertical"
      android:paddingBottom="50dp"
      android:paddingLeft="10dp"
      android:paddingRight="50dp"
      android:paddingTop="50dp"
      android:scaleType="centerCrop"
      android:src="@drawable/logo" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Adding this:</p>
  
  <pre><code>actionBarLogo.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              //code 
          }
      });
  </code></pre>
  
  <p>Results in a Nullpointer exception for this line:</p>
  
  <pre><code>actionBarLogo.setOnClickListener(new View.OnClickListener()
  </code></pre>
  
  <p>The custom layout works fine, i just need the imageview to be clickable. 
  Any ideas how to fix this? 
  How can my activity get a reference to my actionBarLogo id which is defined in actionbar_layout.xml?</p>