title: Can't get Selected Item Index in custom ArrayAdapter on my ListView
body: <p>I have problem with my Android project, because I can't get selected item index from my List with my own ArrayAdapter. I've tried few examples from tutorials but they don't work. What is the solution?</p>
  
  <h1>Adapter</h1>
  
  <pre><code>public class myProductAdapter extends ArrayAdapter&lt;myProductsGroup&gt; {
  
      private List&lt;myProductsGroup&gt; productList;
      private Context context;
  
      public myProductAdapter(List&lt;myProductsGroup&gt; productList, Context ctx) {
          super(ctx, R.layout.list_products_row, productList);
          this.productList = productList;
          this.context = ctx;
      }
  
      @Override
      public int getCount() {
      return productList.size();
      }
  
      /*
      public void onClick(View v) {
          int position = Integer.parseInt((String) v.getTag());
  
          OrderFirstGridPage.setSelectedItem(position);             
      }
      */
  
      public View getView(int position, View convertView, ViewGroup parent) {
  
          if (convertView == null) {
              LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              convertView = inflater.inflate(R.layout.list_products_row, parent, false);
          }
              TextView tv = (TextView) convertView.findViewById(R.id.title);
              tv.setTag(""+position);
              TextView distView = (TextView) convertView.findViewById(R.id.description);
              distView.setTag(""+position);
              tv.setText("aa");
          return convertView;
      }
  }
  </code></pre>
  
  <h1>In activity</h1>
  
  <pre><code>lv = (ListView) findViewById(R.id.listView1);
  lv.setAdapter(new myProductAdapter(setupArrayProductList((ArrayList&lt;myProduct&gt;) ProductList), OrderFirstGridPage.this));
  lv.setSelector(R.drawable.selector_for_position_list);
  </code></pre>