title: Setting tags to each item in a ListView in Android?
body: <p>I have a ListView where I want each item to have an ID number attached to it (not the same as the position number). I was hoping this could be done by setting a tag to each View item in the ListView using <code>setTag()</code> when these Views are being created. </p>
  
  <p>Right now I'm creating the ListView like this:</p>
  
  <pre><code>    final ListView listview = (ListView) findViewById(R.id.listView1);
      ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, android.R.id.text1, names);
      listview.setAdapter(adapter);
  </code></pre>
  
  <p>The <code>names</code> variable in the ArrayAdapter parameters above is an ArrayList, and each string value in this list also has a unique ID that I want to link to this string somehow.</p>
  
  <p>Is there any way I can get access to and modify each of the Views with a tag? One idea was to create my own extended class of ArrayAdapter and override the getView() method, but I don't really understand how it works and how I would go about doing this. </p>
  
  <p>Or is there a better way to link IDs with each string like this than adding tags like I'm trying to do? </p>