开发者

example of how to use class -> SingleLaunchActivityTestCase<T extends Activity>

开发者 https://www.devze.com 2023-01-10 02:12 出处:网络
I am looking for example of how to use this class:开发者_StackOverflow SingleLaunchActivityTestCase<T extends Activity>

I am looking for example of how to use this class:

开发者_StackOverflow
SingleLaunchActivityTestCase<T extends Activity>

Till now I am using class InstrumentationTestCase but the problem is that for each launched test case Android calling onSetup() and TearDown()


Looking at the documentation of those two classes, it looks like the SingleLaunchActivityTestCase is a wrapper class for InstrumentationTestCase. You should be able to use it the same way as you use InstrumentationTestCase; the only difference is in the constructor.

According to the documentation, you need the package name and the class type of the activity. A typical example of this might be:

SingleLaunchActivityTestCase myTestCase;
myTestCase = new SingleLaunchActivityTestCase("com.mycompany.myproject", MyActivity.class);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号