title: IllegalArgumentException upon attempting to start an activity in an ActivityUnitTestCase
body: <p>I'm trying to write a unit test for a specific Activity in aAndroid puzzle game. In each test, I need to launch the Activity with an Intent that has an extra added, then verify that some view in the activity is displaying the proper content for that Intent extra. Here is some code to demonstrate what I'm talking about:</p>
  
  <pre><code>package com.example.puzzlegame;
  
  import android.content.Intent;
  import android.test.ActivityUnitTestCase;
  import android.test.suitebuilder.annotation.MediumTest;
  
  
  public class GameActivityTest extends ActivityUnitTestCase&lt;GameActivity&gt; {
  
      public GameActivityTest(){
          super(GameActivity.class);
      }
  
      @MediumTest
      public void testViews() {
          Intent activityLaunchIntent = new Intent(getInstrumentation().getTargetContext(), GameActivity.class);
          activityLaunchIntent.putExtra("extra1", "somevalue");
          startActivity(activityLaunchIntent, null, null);
  
          //Ensure that views in GameActivity contain correct data, run other tests, etc.
      } 
  </code></pre>
  
  <p>I receive the following IllegalArgumentException however when I try to run my tests.</p>
  
  <pre><code>java.lang.IllegalArgumentException: android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{com.example.puzzlegame/com.example.puzzlegame.GameActivity}
  at android.support.v4.app.NavUtils.getParentActivityName(NavUtils.java:284)
  at android.support.v7.app.AppCompatDelegateImplV7.onCreate(AppCompatDelegateImplV7.java:152)
  at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:60)
  at com.example.puzzlegame.GameActivity.onCreate(GameActivity.java:36)
  at android.app.Activity.performCreate(Activity.java:5990)
  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
  at android.test.ActivityUnitTestCase.startActivity(ActivityUnitTestCase.java:163)
  at com.example.puzzlegame.GameActivityTest.testViews(GameActivityTest.java:29)
  at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
  at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
  at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191)
  at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176)
  at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
  at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1853)
  Caused by: android.content.pm.PackageManager$NameNotFoundException: ComponentInfo{com.example.puzzlegame/com.example.puzzlegame.GameActivity}
  at android.app.ApplicationPackageManager.getActivityInfo(ApplicationPackageManager.java:314)
  at android.support.v4.app.NavUtils.getParentActivityName(NavUtils.java:301)
  at android.support.v4.app.NavUtils.getParentActivityName(NavUtils.java:281)
  ... 20 more
  }
  </code></pre>
  
  <p>The stacktrace shows that the call to startActivity() is causing the IllegalArgumentException, but I'm not sure why. Can anybody help me out? Thanks in advance.</p>