Get specific item property on onListItemClick() using custom ArrayAdapter<>
<p>I have a <code>ListActivity</code> that displays a list of search results I grab from a webservice off the internet. I parse the XML I receive into an <code>ArrayList&lt;MyObjects&gt;</code> which I then bind to a <code>ListView</code> using my own adapter (as in <code>MyObjectAdapter</code> extends <code>ArrayAdapter&lt;MyObject&gt;</code>).</p>

<p>So then I want the user to be able to click on one of the items in the list. Each item has an identifier which will then be put into an intent and sent to a new activity (which then triggers a new webservice request based on this, downloads the rest of the data). But I don't know how to get this one property of the <code>MyObject</code> that was selected.</p>

<p>Here's the <code>onListItemClick()</code> method as it stands:</p>

<pre><code>@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
  super.onListItemClick(l, v, position, id);

  String myObjectId;

  // I want to get this out of the selected MyObject class here

  Intent i = new Intent(this, ViewObject.class);
  i.putExtra("identifier_key", myObjectId);
  startActivityForResult(i, ACTIVITY_VIEW);
}
</code></pre>
