How can you tell which item is clicked on ListView?
<p>I have a bunch of items on my ListView, but I don't know how to implement a listener on a specific items. I also tried to use the if statement and still didn't work.</p>

<p>I tried this code:</p>

<pre><code>list.setOnItemClickListener(new OnItemClickListener() {                                                                                                                                                             
        public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int position,long id)                               
        {                                                                                                                                                                           
            if(list.getItemAtPosition(position).equals(mStrings[0]))                                                       
            {                                                                                                           
                Intent i = new Intent(MainActivity.this, Activity2.class);                                                                                        
                startActivity(i);                                                                                
                }                                                                                                    
            }                                                                                                       
        });
}
</code></pre>

<p>But this code is applied to all items. Please help me with this, I would really appreciate it a lot. Thanks in advance!</p>
