title: ListView Not Working
body: <p>I have made a simple listview and now want the buttons to correspond to a new activity I have used a case statement for this to happen heres my code.</p>
  
  <pre><code>    package com.example.lookingatics;
  
  import android.app.Activity;
  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.ListView;
  import android.widget.TextView;
  
  public class OtherActivity extends Activity{
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
          setContentView(R.layout.other_activity);
  
          ListView listView = (ListView) findViewById(R.id.mylist);
          final String[] values = new String[] { "Science", "Maths", "English", "History", "Geography",
                  "R.E", "I.C.T", "Arabic", "Art", "MainActivity" };
  
          // Define a new Adapter
          // First parameter - Context
          // Second parameter - Layout for the row
          // Third parameter - ID of the TextView to which the data is written
          // Forth - the Array of data
  
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,
            android.R.layout.simple_selectable_list_item, android.R.id.text1, values);
  
  
          // Assign adapter to ListView
          listView.setAdapter(adapter);
  
          listView.setOnItemClickListener(new OnItemClickListener() {
                public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                    int position, long id) {
                    final TextView mTextView = (TextView)view;
                    switch (position) {
                      case 0:
                       Intent newActivity0 = new Intent("com.example.lookingatics.OtherActivity");     
                       startActivity(newActivity0);
                      break;
                      case 1:
                       Intent newActivity1 = new Intent("com.example.lookingatics.MainActivity");     
                       startActivity(newActivity1);
                      break;
                      case 2:
                       Intent newActivity2 = new Intent("com.example.lookingatics.OtherActivity");     
                       startActivity(newActivity2);
                      break;
                      case 3:
                       Intent newActivity3 = new Intent("com.example.lookingatics.MainActivity");     
                       startActivity(newActivity3);
                      break;
                      default:
                        // Nothing do!
                    }
  
                }
              });
  
      }
  
  
  
  }
  </code></pre>
  
  <p>and here's my manifest</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.lookingatics"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="2"
          android:targetSdkVersion="17" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name="com.example.lookingatics.MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.example.lookingatics.OtherActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.OTHER" /&gt;
  
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Does anyone know what my problem is and why do I keep on getting my App saying not responding?</p>