【发布时间】:2018-01-04 12:21:02
【问题描述】:
我正在尝试从存在于不同文件中的另一个类调用方法。
主文件:
public class Test extends AndroidTestCase {
mTestUtils = new TestUtils(this, TAG, OUTPUT_FILE);
第二个文件:
public class TestUtils {
public TestUtils(Context context, String tag, String outputFile) {
mContext = context;
mTag = tag;
mOutputFile = outputFile;
}
}
它抛出构造函数未定义错误。 任何帮助将不胜感激。
【问题讨论】:
-
你的测试类中如何定义tag和output_file?
-
请提供minimal reproducible example。您的第一个 sn-p 代码由于各种原因无法编译,我们不知道
TAG或OUTPUT_FILE的类型,您也没有包含完整的错误文本。 -
Context context-AndroidTestCase是否分别扩展。实现Context? -
附注
Public class Test应该是public class Test
标签: java android constructor