title: How to get a currently active Activity?
body: <p>I'm doing some tests using <code>ActivityInstrumentationTestCase2&lt;&gt;</code> class. Sometimes I launch new <code>Activities</code> within my test so <code>getActivity().finish()</code> isn't working to close current <code>Activity</code> which prevents further tests execution. Is there a way to get a reference to currently opened activity? </p>