title: Android app suddenly stops
body: <p>I am learning the basics of android programming. Now I have made a Life Cycle test. The list activity works fine, but when I attempt to open the Life Cycle test, the app stops and closes. I have got the same problem on several devices. These are my codes:</p>
  
  <p>(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.badlogic.androidgames"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="8"
          android:targetSdkVersion="21" /&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=".AndroidBasicsStarter"
              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;/application&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
      &lt;uses-permission android:name="android.permission.WAKE_LOCK"/&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>(AndroidBasicsStarter.java)</p>
  
  <pre><code>package com.badlogic.androidgames;
  
  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 AndroidBasicsStarter extends ListActivity {
      String tests[] = { "LifeCycleTest", "SingleTouchTest", "MultiTouchTest", "KeyTest",
              "AccelerometerTest", "AssetsTest", "ExternalStorageTest", "SoundPoolTest",
              "MediaPlayerTest", "FullScreenTest", "RenderViewTest", "ShapeTest", "BitmapTest",
              "FontTest", "SurfaceViewTest"
      };
  
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setListAdapter(new ArrayAdapter&lt;String&gt;(this,
                  android.R.layout.simple_list_item_1, tests));
      }
  
      @Override
      protected void onListItemClick(ListView list, View view, int position, long id) {
          super.onListItemClick(list, view, position, id);
          String testName = tests[position];
          try {
              Class clazz = Class
                      .forName("com.badlogic.androidgames." + testName);
              Intent intent = new Intent(this, clazz);
              startActivity(intent);
          } catch (ClassNotFoundException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>(LifeCycleTest.java)</p>
  
  <pre><code>package com.badlogic.androidgames;
  
  import android.app.Activity;
  import android.os.Bundle;
  import android.util.Log;
  import android.widget.TextView;
  
  public class LifeCycleTest extends Activity {
      StringBuilder builder = new StringBuilder();
      TextView textView;
  
      private void log(String text) {
          Log.d("LifeCycleTest", text);
          builder.append(text);
          builder.append('\n');
          textView.setText(builder.toString());
      }
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          textView = new TextView(this);
          textView.setText(builder.toString());
          setContentView(textView);
          log("created");
      }
  
      @Override
      protected void onResume() {
          super.onResume();
          log("resumed");
      }
  
      @Override
      protected void onPause() {
          super.onPause();
          log("paused");
  
          if (isFinishing()) {
              log("finishing");
          }
      }
  }
  </code></pre>
  
  <p>I use <em>Eclipse</em> on Windows 7. Thank you in advance!</p>