title: Custom View Buttons
body: <p>What I have here is a custom view and then I want some widgets to go with it. </p>
  
  <pre><code>&lt;com.zone.manager.Tab3
      android:id="@+id/tab3_display"
      android:layout_width="fill_parent"
      android:layout_height="620dp" &gt;
  
  &lt;Button
      android:id="@+id/addZone"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Add Zone" /&gt;
  
  &lt;/com.zone.manager.Tab3&gt;
  </code></pre>
  
  <p>Now I want to have that button set to onclicklistener so I can do stuff with it in the View class so I did this...</p>
  
  <pre><code>addZone = (Button) findViewById(R.id.addZone);
  
  
    addZone.setOnClickListener(this);
  </code></pre>
  
  <p>I set that in the </p>
  
  <pre><code>public class Tab3 extends ViewGroup implements OnTouchListener, OnClickListener
      Public Tab3(Context context, AttributeSet attrs) 
      {
      super (context, attrs); 
      // here
      }
  </code></pre>
  
  <p>When I extended ViewGroup it made me implement this</p>
  
  <pre><code>@Override
      protected void onLayout(boolean changed, int l, int t, int r, int b) 
      {
          // TODO Auto-generated method stub
  
      }
  </code></pre>
  
  <p>Is there something that I am suppsot to put in here in order to make this work?</p>
  
  <p>But when I try to run the app it crashes, however if I // out the <code>addZone.setOnClickListener(this);</code> the app runs fine, any help for me?</p>
  
  <p>tabs</p>
  
  <pre><code>        th.setup();
          TabSpec specs = th.newTabSpec("tag0");
          specs.setContent(R.id.connecttionTab);
          specs.setIndicator("Connection Tab");
          th.addTab(specs);
          specs = th.newTabSpec("tag1");
          specs.setContent(R.id.tab1);
          specs.setIndicator("Zone Manager");
          th.addTab(specs);
          specs = th.newTabSpec("tag2");
          specs.setContent(R.id.tab2);
          specs.setIndicator("",res.getDrawable(R.drawable.ic_tab_vaccontrol));
          th.addTab(specs);
          //this is the tab that has all this vvv
          specs = th.newTabSpec("tag3");
          specs.setContent(R.id.tab3);
          specs.setIndicator("Graphical Layout");
          th.addTab(specs);
  </code></pre>