title: Get Id from Linear Layout Dynamically on click Android
body: <p>I have 4 LinearLayout in my activity i want to get the id of clicked layout how can i get it ??![enter image description here][1]</p>
  
  <p>Url of view image: <a href="http://postimg.org/image/uq4hnmlkn/" rel="nofollow">http://postimg.org/image/uq4hnmlkn/</a></p>
  
  <p>LinearLayout lt = new LinearLayout(null) ;</p>
  
  <pre><code>    lt.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
  
  
                    Toast.makeText(getApplicationContext(), String.valueOf(v.getId()), 
                             Toast.LENGTH_LONG).show();
  
          }
      });
  </code></pre>