title: Is it OK to instantiate OnClickListeners in getView() of BaseAdapter
body: <p>So I have a custom adapter that extends BaseAdapter. And in the getView() function, I instantiate a handful of OnClickListeners to handle onClick events for views inside the list index (for the ListView). Here is an example:</p>
  
  <pre><code>public class CustomAdapter extends BaseAdapter {
  
      private ArrayList&lt;SomeObject&gt; mObjectArray;
      private LayoutInflater mInflater;
  
      // ...
  
      public View getView(int position, View convertView, ViewGroup parent) {
          final SomeObject obj = mObjectArray.get(position);
  
          convertView = mInflater.inflate(R.layout.custom_layout, null);
  
          TextView textView = TextView) convertView.findViewById(R.id.custom_text1);
  
          textView.setOnClickListener(new OnClickListener() {
              @Override
              public void onClick(View v) {
                  textView.setText(obj.getText());
              }
          });
  
          // ...
  
          return convertView;
      }
  }
  </code></pre>
  
  <p>It works fine, but I'm concerned if this is not recommended from performance standpoint? Is it better to have one OnClickListener for the CustomAdapter class and use TextView.setTag() and TextView.getTag() to customize it? Like below:</p>
  
  <pre><code>public View getView(int position, View convertView, ViewGroup parent) {
      // ...
      textView.setTag(obj);
      textView.setOnClickListener(oneOnClickListener);
      // ...
  }
  
  // ...
  
  // One OnClickListener to handle all onClick events for textView
  OnClickListener oneOnClickListener = new OnClickListener() {
      @Override
      public void onClick(View v) {
          SomeObject obj = v.getTag();
          textView.setText(obj.getText());
      }
  });
  </code></pre>
  
  <p>Or is instantiating new OnClickListener in getView() function considered OK? Thanks</p>