How to get a view from within Espresso to pass into an IdlingResource?
<p>I essentially have a custom <code>IdlingResource</code> that takes a <code>View</code> a constructor argument. I can't find anywhere that really talks about how to implement it.</p>

<p>I'm trying to use this answer: <a href="https://stackoverflow.com/a/32763454/1193321">https://stackoverflow.com/a/32763454/1193321</a></p>

<p>As you can see, it takes a <code>ViewPager</code>, but when I'm registering the <code>IdlingResource</code> in my test class, I'm not sure how I can get my view.</p>

<p>I've tried <code>findViewById()</code> and I've tried getting the currently running activity and then calling <code>findViewById()</code> on that, with no luck. </p>

<p>Anyone know what to do in this scenario?</p>