I am trying to test a library developed by me through jUnit, but I’m having some problems. This library requires an activity to be instantiated. However, following the tutorial (http://www.vogella.com/articles/JUnit/article.html), I can not instantiate the object because I dont have the activity. You can create a dummy activity?
Thanks 🙂
To test an
Activityyou should normally use ActivityInstrumentationTestCase2. When you invokegetActivity()theActivityunder test will be created.If you are testing a library project, the post android: testing library project would be also of help.