Q:

Adding multiple event to listview

I searched stackoverflow but couldnt find a answer(sure there is one somewhere) but I am trying to add a activity for each listview input. I can manage it with one intent but how do I give each listview input  a seperate activity. So to be clear, I want to make every item have a serperate activity.
Currently use this code to initiate a activity but want individual activities for each item.
public class ListviewActivityActivity extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // storing string resources into Array
    String[] adobe_products = getResources().getStringArray(R.array.list_products);

    // Binding resources Array to ListAdapter
    this.setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, R.id.label, adobe_products));

    ListView lv = getListView();

    // listening to single list item on click
    lv.setOnItemClickListener(new OnItemClickListener() {
      public void onItemClick(AdapterView<?> parent, View view,
          int position, long id) {

          // selected item
          String product = ((TextView) view).getText().toString();

          // Launching new Activity on selecting single List Item
          Intent i = new Intent(getApplicationContext(), BMICalculatorActivity.class);
          startActivity(i);

      }
    });
}

Have tried adding this but it failed to work
private static final int ACTIVITY_0 = 0;
          private static final int ACTIVITY_1 = 1;
          private static final int ACTIVITY_2 = 2;

          protected void onListItemClick(ListView l, View v, int position, long id)
          {
              super.onListItemClick(l, v, position, id);
              final Intent intent = new Intent();
              // Set up different intents based on the item clicked: 
              switch (position)
              {
                  case ACTIVITY_0:
                      intent.setClass(this, listview.activty.BMICalculatorActivity.class);
                      break;
                  case ACTIVITY_1:
                      intent.setClass(this, listview.activty.BodyLog.class);
                      break;

I know its probally simple to sort so any help would be amazing. Thanks

A:

I think you want something like this : 
     Intent i = null;
     switch (position)
          {
              case ACTIVITY_0:
                  i = new Intent(getApplicationContext(), BMICalculatorActivity.class);
                  break;
              case ACTIVITY_1:
                  i = new Intent(getApplicationContext(), BodyLog.class);
                  break;
          }

      if(i != null)
      {
         startActivity(i);
      }

