How to use Android compoud controls?
<p>I'm trying to make a simple application that uses so called compound controls.</p>

<p>My Compound control consists of two Views: EditText and Button.
The definition for the compound control: <strong>editbox_runbutton.xml</strong></p>

 <pre class="lang-xml prettyprint-override"><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
       &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
           android:orientation="vertical" 
           android:layout_width="match_parent"
           android:layout_height="wrap_content" &gt;
       &lt;EditText 
           android:id="@+id/editText"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:hint="@string/entryBoxHint" /&gt;
       &lt;Button 
           android:id="@+id/runButton"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:text="@string/runButtonText" /&gt;      
      &lt;/LinearLayout&gt;
</code></pre>

<p>The main activity <strong>intent_practice_main_activity.xml</strong> includes the compound control layout:</p>

 <pre class="lang-xml prettyprint-override"><code> &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" &gt;
    &lt;include layout="@layout/editbox_runbutton"
        android:name="com.example.simple.in"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="top"/&gt;
&lt;/RelativeLayout&gt;
</code></pre>

<p>As I understand compound controls, I can implement their functionality in a separate class. To do so I created <strong>EditBox_RunButton</strong>:</p>

 <pre class="lang-java prettyprint-override"><code>public class EditBox_RunButton extends LinearLayout {
EditText editText;
Button runButton;

public EditBox_RunButton(Context context){
        super(context);

      // Inflate the view from the layout resource
      String infService = Context.LAYOUT_INFLATER_SERVICE;

      LayoutInflater li = (LayoutInflater)getContext().getSystemService(infService);
      li.inflate ( R.layout.editbox_runbutton, this, true ) ;

      // Get references to the child controls
      editText = (EditText)findViewById(R.id.editText);
      runButton = (Button)findViewById(R.id.runButton);

      //Hook up the functionality
      hookupButton();
}

private void hookupButton(){
     runButton.setOnClickListener( new Button.OnClickListener() {
        public void onClick( View v) {
             //TODO: GET TEXT FROM THE BOX AND RUN INTENT
             editText.setText("some text");
        }
     });
}
</code></pre>

<p>}</p>

<p>When I run the application I get the UI in main activity, but it's unusable.
So my main question is how do I "hook up" the <strong>EditBox_RunButton</strong> class to the main activity?</p>
