title: Trying to link an activity from a listActivity
body: <p>I have a list menu that links to another list menu and into an activity called counter. But the counter keeps throwing an exception and not show me the actual counter activity </p>
  
  <p>here's the code below</p>
  
  <pre><code>package com.example.taekwondobuddy.util;
  
  import android.app.ListActivity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.ArrayAdapter;
  import android.widget.ListView;
  
  public class Tools extends ListActivity{
  
  String classes[] = {"Counter","Accelermeter","Timer"} ;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setListAdapter(new ArrayAdapter&lt;String&gt;(Tools.this,  android.R.layout.simple_list_item_1, classes));
  }
  
  
  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
      // TODO Auto-generated method stub
      super.onListItemClick(l, v, position, id);
      String cheese = classes[position];
      try{
      Class ourclass = Class.forName("com.example.taekwondobuddy.util" + cheese);
      Intent ourIntent = new Intent(Tools.this, ourclass);
      startActivity(ourIntent);
      } catch(ClassNotFoundException e){
          e.printStackTrace();
  
      }
     }
  
       } 
  </code></pre>
  
  <p>the tool class</p>
  
  <pre><code>package com.example.taekwondobuddy.util;
  
  import android.app.ListActivity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.ArrayAdapter;
  import android.widget.ListView;
  
  public class Tools extends ListActivity{
  
  String classes[] = {"Counter","Accelermeter","Timer"} ;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setListAdapter(new ArrayAdapter&lt;String&gt;(Tools.this, android.R.layout.simple_list_item_1, classes));
  }
  
  
  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
      // TODO Auto-generated method stub
      super.onListItemClick(l, v, position, id);
      String cheese = classes[position];
      try{
      Class ourclass = Class.forName("com.example.taekwondobuddy.util" + cheese);
      Intent ourIntent = new Intent(Tools.this, ourclass);
      startActivity(ourIntent);
      } catch(ClassNotFoundException e){
          e.printStackTrace();
  
      }
     }
  
    }
  </code></pre>
  
  <p>the counter class </p>
  
  <pre><code>package com.example.taekwondobuddy.util;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.TextView;
  </code></pre>
  
  <p>public class Counter extends Activity {</p>
  
  <pre><code>int counter;
  Button add;
  Button sub;
  TextView display;
  
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.counter);
  
      counter = 0;
      add = (Button) findViewById(R.id.button1);
      sub = (Button) findViewById(R.id.button2);
      display = (TextView) findViewById(R.id.tvDisplay);
      add.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
              counter++;
              display.setText("Counter: " + counter);
          }
      });
      sub.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              // TODO Auto-generated method stub
              counter--;
              display.setText("Counter: " + counter);
          }
      });
     }
  
   }
  </code></pre>
  
  <p>and the counter.xml if that helps anyone</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent" &gt;
  
  
  &lt;TextView
      android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:text="Counter: 0"
  android:textSize="45dp"
  android:layout_gravity="center"
  android:id="@+id/tvDisplay"
  
      &gt;&lt;/TextView&gt;
  
  &lt;Button
      android:id="@+id/button1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="150dp"
      android:text="Add" /&gt;
  
  &lt;Button
      android:id="@+id/button2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@+id/button1"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="25dp"
      android:text="Subtract" /&gt;
  
   &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>I can't see what can be wrong any ideas?</p>