Issue
I need to access both test and application Context
in a test. I couldn't find an Android test type (InstrumentationTestCase
, AndroidTestCase
...) allowing to do it. Any hint?
Solution
Finally found it. Use InstrumentationTestCase
with:
- getInstrumentation().getContext(): to get test Context
- getInstrumentation().getTargetContext(): to get target application Context
Answered By - L. G.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.