Android: NullPointerException
<p>I am trying to run the following Android app, but I get a NullPointerException</p>

<p>Main.java</p>

<pre><code>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 Main extends ListActivity {
 String[] listActivityNames = 
  {"Text1", "Text2", "Text3", "Text4"};

    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);

        // Use an existing ListAdapter that will map an array
        // of strings to TextViews

        setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, listActivityNames));
        getListView().setTextFilterEnabled(true);
 }

 /*protected void onListItemClick(ListView l, View v, int position, long id) {
  Intent myIntent = new Intent();
  myIntent.setClassName("com.utsc", "com.utsc.Announcements");
  startActivity(myIntent); 
 }*/
}
</code></pre>

<p>Console:</p>

<pre><code>[2011-01-26 13:58:57 - ddms]null
java.lang.NullPointerException
 at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213)
 at com.android.ddmlib.Client.sendAndConsume(Client.java:573)
 at com.android.ddmlib.HandleHello.sendHELO(HandleHello.java:142)
 at com.android.ddmlib.HandleHello.sendHelloCommands(HandleHello.java:65)
 at com.android.ddmlib.Client.getJdwpPacket(Client.java:670)
 at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:317)
 at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)

[2011-01-26 13:58:57 - ddms]null
java.lang.NullPointerException
 at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213)
 at com.android.ddmlib.Client.sendAndConsume(Client.java:573)
 at com.android.ddmlib.HandleHello.sendHELO(HandleHello.java:142)
 at com.android.ddmlib.HandleHello.sendHelloCommands(HandleHello.java:65)
 at com.android.ddmlib.Client.getJdwpPacket(Client.java:670)
 at com.android.ddmlib.MonitorThread.processClientActivity(MonitorThread.java:317)
 at com.android.ddmlib.MonitorThread.run(MonitorThread.java:263)
</code></pre>
