Multiple activitys on listview clickable
<p>I have a problem with my code iv been trying to fix this error but still no luck. I would like a new activity to start when a item in the list view is clicked i looked for some time a found this code </p>

<pre><code>  public void onItemClick(AdapterView&lt;?&gt; parent, View view,
  int position, long id) {
  switch( position )
  {
   case 0:  Intent newActivity = new Intent(this, superleague.class);     
            startActivity(newActivity);
            break;
   case 1:  Intent newActivity = new Intent(this, youtube.class);     
            startActivity(newActivity);
            break;
   case 2:  Intent newActivity = new Intent(this, olympiakos.class);     
            startActivity(newActivity);
            break;
   case 3:  Intent newActivity = new Intent(this, karaiskaki.class);     
            startActivity(newActivity);
            break;
   case 4:  Intent newActivity = new Intent(this, reservetickets.class);     
            startActivity(newActivity);
            break;
     }
    }
</code></pre>

<p>Now i placed this in my project and it where the problem is but as i am new to this its taking some time to fix the small things hope you can help?</p>

<pre><code> package com.mybasicapp;

  import android.app.Dialog;
  import android.app.ListActivity;
  import android.content.DialogInterface;
  import android.content.DialogInterface.OnCancelListener;
  import android.content.DialogInterface.OnDismissListener;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.AdapterView.OnItemClickListener;
  import android.widget.ArrayAdapter;
  import android.widget.Button;
  import android.widget.ImageButton;
  import android.widget.ListView;
  import android.widget.Toast;

  public class menu extends ListActivity implements onListItemClickListner{


  ImageButton ImagebuttonOpenDialog;

   String KEY_TEXTPSS = "TEXTPSS";
   static final int CUSTOM_DIALOG_ID = 0;

    ListView dialog_ListView;

    String[] listContent = {
 "FORD", "BMW", "AUDI", "JAGUAR",
 "MERCEDES", "RENAULT", "ROVER", "SAAB", "BENTLEY",
 "VOLVO", "VAUXHALL", "SEAT"};


  protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

  ListView lv = getListView();
  lv.setTextFilterEnabled(true);

  lv.setOnListItemClickListener(new OnListItemClickListener() {
  public void onListItemClick(AdapterView&lt;?&gt; parent, View view,
          int position, long id) {
        switch( position )
        {
           case 0:  Intent newActivity = new Intent(this, 
         Pickmodel.class);     
                    startActivity(newActivity);
                    break;
           case 1:  Intent newActivity = new Intent(this, 
         Pickmodel.class);     
                    startActivity(newActivity);
                    break;
           case 2:  Intent newActivity = new Intent(this, 
         Pickmodel.class);     
                    startActivity(newActivity);
                    break;
           case 3:  Intent newActivity = new Intent(this, 
         Pickmodel.class);     
                    startActivity(newActivity);
                    break;
           case 4:  Intent newActivity = new Intent(this, 
         Pickmodel.class);     
                    startActivity(newActivity);
                    break;
        }
      }




   ImagebuttonOpenDialog = (ImageButton)findViewById(R.id.imgbtn1);
   ImagebuttonOpenDialog.setOnClickListener(new Button.OnClickListener(){

    public void onClick(View arg0) {
        showDialog(CUSTOM_DIALOG_ID);
       }});

        }

     @Override
     protected Dialog onCreateDialog(int id) {

      Dialog dialog = null;

      switch(id) {
         case CUSTOM_DIALOG_ID:
          dialog = new Dialog(menu.this);
          dialog.setContentView(R.layout.custom);
          dialog.setTitle("Custom Dialog");

          dialog.setCancelable(true);
          dialog.setCanceledOnTouchOutside(true);

          dialog.setOnCancelListener(new OnCancelListener(){

        public void onCancel(DialogInterface dialog) {
         // TODO Auto-generated method stub
         Toast.makeText(menu.this,
           "OnCancelListener",
           Toast.LENGTH_LONG).show();
        }});

          dialog.setOnDismissListener(new OnDismissListener(){

        public void onDismiss(DialogInterface dialog) {
         // TODO Auto-generated method stub
         Toast.makeText(menu.this,
           "OnDismissListener",
           Toast.LENGTH_LONG).show();
        }});

          //Prepare ListView in dialog
          dialog_ListView = (ListView)dialog.findViewById(R.id.dialoglist);
          ArrayAdapter&lt;String&gt; adapter
           = new ArrayAdapter&lt;String&gt;(this,
             android.R.layout.simple_list_item_1, listContent);
          dialog_ListView.setAdapter(adapter);
          dialog_ListView.setOnItemClickListener(new OnItemClickListener(){

        public void onItemClick(AdapterView&lt;?&gt; parent, View view,
          int position, long id) {
         // TODO Auto-generated method stub
         Toast.makeText(menu.this,
           parent.getItemAtPosition(position).toString() + " clicked",
           Toast.LENGTH_LONG).show();
         dismissDialog(CUSTOM_DIALOG_ID);
        }});

             break;
         }

      return dialog;
     }

     @Override
     protected void onPrepareDialog(int id, Dialog dialog, Bundle bundle) {
      // TODO Auto-generated method stub
      super.onPrepareDialog(id, dialog, bundle);

      switch(id) {
         case CUSTOM_DIALOG_ID:
          //
             break;
         }

     }

    public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,
            long arg3) {
        // TODO Auto-generated method stub

    }

    }


    public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {
     // TODO Auto-generated method stub

      }
</code></pre>

<p>Please let me know if am missing something also thanks
p.s I CANT RUN THIS PROJECT SO I CANT PRINT LOG CAT</p>

<pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/customdialog"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:padding="20dp"
  android:minWidth="300dp"&gt;

&lt;ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/popcar" /&gt;

&lt;ListView
    android:id="@+id/dialoglist"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" /&gt;

&lt;ImageButton
    android:id="@+id/imageButton1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/kj" /&gt;

&lt;/LinearLayout&gt;
</code></pre>
