title: robolectric 2 - create activity with intent
body: <p>Does creating an activity using the <code>.withIntent()</code> not work in Robolectric 2? I'm doing the following </p>
  
  <pre><code>    activity = Robolectric.buildActivity(MyActivity.class)
                              .create()
                              .withIntent(intent)
                              .get();
  </code></pre>
  
  <p>And i'm getting a <code>NullPointerException</code> when doing the following in the <code>onCreate()</code> of my activity.</p>
  
  <pre><code>Bundle bundle = getIntent().getExtras();
  </code></pre>
  
  <p>I can code a null check in my <code>onCreate()</code> and set the intent by doing the following but it seems redundant to set the intent and call the <code>onCreate()</code> method again when Robolectric already does that when creating the <code>Activity</code> instance. This seems like an unnecessary work around. </p>
  
  <pre><code>    Robolectric.shadowOf(activity).setIntent(intent);
      activity.onCreate(null);
  </code></pre>