title: Robolectric - RuntimeException Stub
body: <p>I have a Robolectric test case written as </p>
  
  <pre><code>public void setUp(){
      mActivity = new CalcActivity();
      ShadowActivity shadow = Robolectric.shadowOf(mActivity);
  
  //more code 
  </code></pre>
  
  <p>But i'm getting a <code>RuntimeException : Stub!</code> at the very start of the setUp method.</p>
  
  <pre><code>java.lang.RuntimeException: Stub!
  at android.content.Context.&lt;init&gt;(Context.java:4)
  at android.content.ContextWrapper.&lt;init&gt;(ContextWrapper.java:5)
  at android.view.ContextThemeWrapper.&lt;init&gt;(ContextThemeWrapper.java:5)
  at android.app.Activity.&lt;init&gt;(Activity.java:6)
  at com.example.advancedcalc.CalcActivity.&lt;init&gt;(CalcActivity.java:13)
  at com.example.CalcActivityTest.setUp(CalcActivityTest.java:25)
  </code></pre>
  
  <p>CalcActivity implements an OnclickListener and it has a bunch of other methods that perform basic calculator operations inside.</p>
  
  <p>Can anyone tell me why i'm getting <code>java.lang.RuntimeException: Stub!</code> and how to deal with it ?</p>