title: How to identify which child LinearLayout clicked?
body: <pre><code>whilc(rs.next()){
  data_big_layout = new LinearLayout(this);
  data_big_params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
                          LinearLayout.LayoutParams.WRAP_CONTENT);
  data_big_params.setMargins(0,15,0,0);
  data_big_layout.setLayoutParams(data_big_params);
  data_big_layout.setOrientation(LinearLayout.HORIZONTAL);
  data_big_layout.setWeightSum(20);
  data_big_layout.setBackgroundColor(Color.WHITE);
  data_big_layout.setTag(rs.getInt(1));
  data_big_layout.setOnClickListener(new View.OnClickListener() {
         @Override
         public void onClick(View v) {
             Toast.makeText(getBaseContext(),"ID: "+data_big_layout.getTag(), Toast.LENGTH_LONG).show();
             name.setText("Clicked ID: " + data_big_layout.getTag());
         }
  });
  detail_data_layout = new LinearLayout(this);
  lparams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
                          LinearLayout.LayoutParams.WRAP_CONTENT,8.0f);
  detail_data_layout.setLayoutParams(lparams);
  detail_data_layout.setOrientation(LinearLayout.VERTICAL);
  detail_data_layout.setPadding(50,0,0,0);
  
  lparams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
                          LinearLayout.LayoutParams.WRAP_CONTENT);
  name = new TextView(this);
  name.setLayoutParams(lparams);
  name.setText("ID(get from rs.next): " + rs.getString(1));
  name.setTextSize(24);
  name.setTypeface(Typeface.DEFAULT_BOLD);
  detail_data_layout.addView(name);
  scroll_view_child.addView(data_big_layout); //scroll_view_child is a LinearLayout
  }
  </code></pre>
  
  <p>Hi all, I have a problem cannot solve. The above code will generate two LinearLayout with the onclick function. However, the onclick function cannot identify which one I was clicked. </p>
  
  <p>The two tags I set should be "1" and "2" in the first and second LinearLayout, but all LinearLayout will show "2" when I click it. How can I solve this problem? thanks!</p>
  
  <p>I modified some code for testing, the rs.next can surely get the ID "1" and "2", but when I click the LinearLayout(no matter which layout I was clicked), only the second one will change the Textview.
  Also the getTag() is only showing "2" no matter which LinearLayout I was clicked. </p>
  
  <p>ps: some textview and imageview codes are skipped</p>
  
  <p>Before click:</p>
  
  <p><a href="https://i.stack.imgur.com/MiGcb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MiGcb.png" alt="enter image description here"></a></p>
  
  <p>After clicked(no matter which layout I click):</p>
  
  <p><a href="https://i.stack.imgur.com/MIe0h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MIe0h.png" alt="enter image description here"></a></p>