title: Overiding onFinishInflate() method
body: <p>I am inflating a xml using <code>LayoutInflater</code> as I want this View multiple times (dynamically).</p>
  
  <p>My ònCreate` Method is as follows:</p>
  
  <pre><code> protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.home);
                      v[i]= new View[4];
              LinearLayout linear= (LinearLayout) findViewById(R.id.linearLayout);
  LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              for(int i = 1; i &lt;4; i++) {
  
               v[i]= inflater.inflate(R.layout.row, linear);                         //v[i] returns view i.e. Linear Layout from my row.xml 
              }   
          }
  </code></pre>
  
  <p>my code for row.xml is as follows-</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:background="#ffaf04"
      android:orientation="horizontal"
      android:padding="10dip" &gt;
  
      &lt;LinearLayout
          android:id="@+id/rel1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginRight="5dp"
          android:background="#ffffff"
          android:orientation="vertical"
          android:padding="5dp" &gt;
  
          &lt;ImageView
              android:id="@+id/imageView1inInflatedRow"
              android:layout_width="130dp"
              android:layout_height="wrap_content"
              android:adjustViewBounds="true"
              android:src="@drawable/image_holder" &gt;
          &lt;/ImageView&gt;
  
          &lt;Button
              android:id="@+id/button1inInflatedRow"
              android:layout_width="match_parent"
              android:layout_height="40dp"
              android:layout_marginTop="5dp"
              android:background="@layout/button_selector"
              android:padding="5dip"
              android:textColor="#FFFFFF"
              android:textSize="12sp" &gt;
          &lt;/Button&gt;
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginLeft="5dp"
          android:background="#ffffff"
          android:orientation="vertical"
          android:padding="5dp" &gt;
  
          &lt;ImageView
              android:id="@+id/imageView2inInflatedRow"
              android:layout_width="130dp"
              android:layout_height="wrap_content"
              android:adjustViewBounds="true"
              android:src="@drawable/image_holder" &gt;
          &lt;/ImageView&gt;
  
          &lt;Button
              android:id="@+id/button2inInflatedRow"
              android:layout_width="match_parent"
              android:layout_height="40dp"
              android:layout_marginTop="5dp"
              android:background="@layout/button_selector"
              android:padding="5dip"
              android:textColor="#FFFFFF"
              android:textSize="12sp" &gt;
          &lt;/Button&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Now the row contains Buttons and I want to set an onclick listener for buttons i.e. for <code>button1inInflatedRow</code> and  <code>button2inInflatedRow</code> hich perform same function , but I need to know which button has called the function. So, How do I call <code>findVieById()</code> for these buttons? or is there any other way for calling the button <code>onclick</code>.. ?</p>