title: Android can't find an activity, even though it's declared in the manifest
body: <p>I am trying to start an activity with an intent, but it can't find the activity. This is strange, because I have the activity declared in the manifest. I did everything other StackOverflow posts suggested: I updated Android Studio, updated the SDK tools, and checked for logical errors. Nothing. I have no idea what's going on. Here's my code:</p>
  
  <pre><code>Intent mIntent = new Intent(this, ItemsActivity.class);
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      ...
  
      Button button2 = (Button) findViewById(R.id.button2);
      button2.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
              String[] itemsArray = new String[items.size()];
              String[] quantitiesArray = new String[quantities.size()];
  
              for (int i = 0; i &lt; items.size(); i++) {
                  itemsArray[i] = items.get(i);
                  quantitiesArray[i] = quantities.get(i);
              }
  
              Bundle extras = new Bundle();
              extras.putStringArray("items", itemsArray);
              extras.putStringArray("quantities", quantitiesArray);
              //mIntent.putExtras(extras);
              startActivity(mIntent);
          }
      });
  </code></pre>
  
  <p>Here's the manifest:</p>
  
  <pre><code>&lt;application
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name=".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=".ItemsActivity"
          android:label="@string/list_name"&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>Everything is correct; I debugged to make sure there are no other errors. Everything is fine, but it just can't find the activity. Here's the actual error in the log:</p>
  
  <pre><code>04-03 22:45:40.846  27796-27796/com.example.android.hackathonapp E/AndroidRuntime﹕ FATAL EXCEPTION: main
  Process: com.example.android.hackathonapp, PID: 27796
  android.content.ActivityNotFoundException: Unable to find explicit activity class {/com.example.android.hackathonapp.ItemsActivity}; have you declared this activity in your AndroidManifest.xml?
          at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1636)
          at android.app.Instrumentation.execStartActivity(Instrumentation.java:1430)
          at android.app.Activity.startActivityForResult(Activity.java:3532)
          at android.app.Activity.startActivityForResult(Activity.java:3493)
          at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:817)
          at android.app.Activity.startActivity(Activity.java:3735)
          at android.app.Activity.startActivity(Activity.java:3703)
          at com.example.android.hackathonapp.MainActivity$2.onClick(MainActivity.java:56)
          at android.view.View.performClick(View.java:4654)
          at android.view.View$PerformClick.run(View.java:19438)
          at android.os.Handler.handleCallback(Handler.java:733)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:146)
          at android.app.ActivityThread.main(ActivityThread.java:5602)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:515)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
          at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>I'm completely stuck. Can someone please help me out? Thanks in advance :)</p>