title: Android add ID to a layout
body: <p>How do I define an ID to a layout?</p>
  
  <p>I am trying to add an ID to a linearlayout and setting an onclick listener:</p>
  
  <p>XML:</p>
  
  <pre><code>&lt;LinearLayout
     android:id="@+id/?????????"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical"
     android:onClick="btnHandler" &gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Class:</p>
  
  <pre><code>public class MainActivity extends Activity {
      //....
  
      public void btnHandler(View v){
         switch(v)
         {
            case R.id.????? :
         }
      }
  }
  </code></pre>