How to get selected item index in andoid listview?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3405369/getting-the-index-of-clicked-item-in-a-listview">getting the index of clicked item in a listview</a>  </p>
</blockquote>



<p>I have a listview, and I want to get the selected item index to do some process on it</p>

<p>how can I get this index as an integer value ?</p>

<p>this is my code:</p>

<pre><code>final ListView list = (ListView)findViewById(android.R.id.list);
    list.setClickable(true);
    list.setOnItemClickListener(new AdapterView.OnItemClickListener() {

    public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int position, long arg3) {

      }
    });
</code></pre>

<p>thanks all </p>
