title: Get activity `ViewDataBinding` field inside `Robolectric` unit test after being assigned
body: <p>I am writing a Robolectric unit test which requires me to make use of the activity under test view data binding class(<code>ViewDataBinding</code>), unfortunately with no luck I am stuck with it being null inside of the unit test</p>
  
  <p>inside of <code>MainActiviy</code> class:</p>
  
  <pre><code>...
  ActivityMainBinding binding; // &lt;-- this field returns null inside unit test
  ...
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
  }
  ...
  </code></pre>
  
  <p>If anyone has written a test with a similar requirement please could you demonstrate an example of how you got the <code>ViewDataBinding</code> classed to be assigned before the test completed. Thanks!</p>
  
  <blockquote>
    <p>Note: I am using <code>Android Studio 2.2</code> </p>
  </blockquote>