title: startActivity makes the app force close
body: <p>I just started development for Android, and I am stuck with this code:</p>
  
  <pre><code>public class Home extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.home);
          Button buttonFoo = (Button)findViewById(R.id.buttonFoo);
          buttonFoo.setOnClickListener(openFoo);
      }
  
      public OnClickListener openFoo = new OnClickListener() {
          public void onClick(View v) {
              Intent intent = new Intent(Home.this, Foo.class);
              startActivity(intent);
          }
      };
  }
  </code></pre>
  
  <p>And here is the code of activity Foo:</p>
  
  <pre><code>public class Foo extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          //populateWithLatest();
      }
  }
  </code></pre>
  
  <p>And the error log:</p>
  
  <pre><code>07-18 19:53:35.043: ERROR/AndroidRuntime(4656): FATAL EXCEPTION: main
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.github.progval.openquote/com.github.progval.openquote.sites.FooActivity}; have you declared this activity in your AndroidManifest.xml?
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at android.app.Activity.startActivityForResult(Activity.java:2827)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at android.app.Activity.startActivity(Activity.java:2933)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at com.github.progval.openquote.Home$1.onClick(Home.java:34)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at android.view.View.performClick(View.java:2501)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at android.view.View$PerformClick.run(View.java:9107)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at android.os.Handler.handleCallback(Handler.java:587)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at android.os.Handler.dispatchMessage(Handler.java:92)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at android.os.Looper.loop(Looper.java:130)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at android.app.ActivityThread.main(ActivityThread.java:3835)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at java.lang.reflect.Method.invokeNative(Native Method)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at java.lang.reflect.Method.invoke(Method.java:507)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
  07-18 19:53:35.043: ERROR/AndroidRuntime(4656):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Unless I comment the line <code>startActivity(intent);</code>, the app force closes when I press the Foo button.</p>