I am writing Unit test case to test an Activity. Extending ActivityUnitTestCase class. Launching basic intent first. Then using TouchUtils, Performing intended actions. there is startActivity() call in my action. While debugging code i am able to see, the activity is started. but when in testcase using getStartedActivityIntent it returns null. What i have to do?
I would advise you to use "Functional Tests" with an ActivityMonitor:
http://developer.android.com/training/activity-testing/activity-functional-testing.html
There starting an activity and verifying it works for me. With getStartedActivityIntent()
using in an ActivityUnitTestCase
also does not work for me.
ActivityUnitTestCase is going to be deprecated. Don't use it anymore. Refer to the following issue
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.