Android how to get id from ArrayAdapter by clicking ImageView
<p>I have placed in ArrayAdapter an ImageView, the list looks like this:</p>

<p>Name1     |ImageView|</p>

<p>Name2     |ImageView|</p>

<p>Name3     |ImageView|</p>

<p>end so on..</p>

<p>I don't know how to get an item id after clicking ImageView.</p>

<pre><code>@Override
public View getView(int position, View contextView, ViewGroup parent) {
    final ViewHolder viewHolder;
    View rowView = contextView;
    final CardList list = _cardList.get(position);

    if (rowView == null) {
        LayoutInflater layoutInflater = _context.getLayoutInflater();
        rowView = layoutInflater.inflate(R.layout.cardlist_viewlist_tpl, null, true);
        viewHolder = new ViewHolder();
        viewHolder.tvCardListName = (TextView) rowView.findViewById(R.id.tvCardListName);
        viewHolder.btnCardListLearn = (ImageView) rowView.findViewById(R.id.btnCardListLearn);
        viewHolder.btnCardListLearn.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                Intent intent = new Intent(_context, LearningCardActivity.class);

                //!!!!!!!!!!!!!!!
                //this doesn't work, I always get 1st positon Id
                intent.putExtra(LearningCardActivity.CURRENT_CARD_LIST_ID, list.getId());
                //!!!!!!!!!!!!!!!!

                _context.startActivity(intent);
            }
        });

        rowView.setTag(viewHolder); 
    } else {
        viewHolder = (ViewHolder) rowView.getTag();
    }

    viewHolder.tvCardListName.setText(list.getName());

    return rowView;
}
</code></pre>
