I am looking for example of how to use this class:
开发者_StackOverflowSingleLaunchActivityTestCase<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);
精彩评论