title: How the view are refereed under MainActivity In android
body: <p>Here is the XML code for a simple TextView:</p>
  
  <pre><code>&lt;TextView  
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:text="@string/hello"
      android:id="@+id/test"/&gt;
  </code></pre>
  
  <p>Then, in MainActivity, it is used like this:</p>
  
  <pre><code>TextView test = (TextView) findViewById(R.id.test);
  test.setText("test");
  </code></pre>
  
  <p>I want to know how the view is accessed in Main class, which is defined in xml layout. </p>
  
  <p>Can anyone explain how it happens?</p>