title: How do i use the OnItemClickListener to start a new intent based on which item is clicked?
body: <p>I want to be able to start a new activity using the Intent class. I know how to start an activity by using these lines of code:</p>
  
  <pre><code>Intent myIntent = new Intent(v.getContext(), bylocationactivity.class);
  
  startActivityForResult(myIntent, 0);
  </code></pre>
  
  <p>But how do i specify which item has been clicked? So when I click "By Location" I can start the bylocationactivity.class and so on?</p>
  
  <pre><code>public class bonesactivity extends Activity 
  {
      public void onCreate(Bundle savedInstanceState) 
      {
          ListView boneslist;
          String categorieslist[]={"Alphabetically","By Location","Specialty Tests"};
          super.onCreate(savedInstanceState);
          setContentView(R.layout.boneslayout);
          boneslist=(ListView)findViewById(R.id.boneslayout);
          boneslist.setAdapter(new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1 , categorieslist));
          boneslist.setOnItemClickListener(new OnItemClickListener() 
          {
              public void onItemClick(AdapterView&lt;?&gt; parent, View view,int position, long id)
              {
  
              }
          });
      }      
  }
  </code></pre>