how to implement a listener on specific items using ListVIew?
<p>I created a ListView with bunch of items, but I am not actually sure how to implement a listener on a specific items. Please help me! I would realy applreacte it a lot.</p>

<p>I tried to use this code, but when I click on any items, it will only bring me to the same Activity.</p>

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

<p>But if I use this code with if statement, nothing is happening:</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>
