title: Write method inside getView
body: <p>I am trying to write a method inside <code>getView()</code> in a <code>listview</code> adapter as below</p>
  
  <pre><code>public class CardsDataAdapter extends ArrayAdapter&lt;String&gt;  {
      public CardsDataAdapter(Context context) {super(context, R.layout.view);}
  
      @Override
      public View getView(int position, final View contentView, ViewGroup parent){
         TextView text = (TextView)(contentView.findViewById(R.id.content));
         text.setText(getItem(position));
  
      //This is the method I want to trigger, but says it's not allowed to write here
       public static void triggerThis(){
      dothisthing.method(getItem(position))
      }
  
  return contentView;}
  </code></pre>
  
  <p>I need a static method because I want to call it in another class. I have searched everywhere to find other solutions to trigger that kind of action but no success.</p>