title: How to add onclicklistener to dynamically generated text view?
body: <p>In my application generating dynamic text view. I want to add onclickListener to my text view.
  How can I do it please give me some hint.
  Here hard code for textview .</p>
  
  <pre><code>        for (int i = 0; i &lt; subCategory.length; i++) {
          TextView tv = new TextView(this);
          tv.setText(subCategory[i]);
          tv.setId(i);
          sCategoryLayout.addView(tv);
  
      }
  </code></pre>