Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/209.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
AndroidTestCase从资源文件夹获取文件_Android_Android Testing - Fatal编程技术网

AndroidTestCase从资源文件夹获取文件

AndroidTestCase从资源文件夹获取文件,android,android-testing,Android,Android Testing,我的项目结构如下: src --main ----java ----res --test ----java ----resources 如何从AndroidTestCase访问resources文件夹中的文件?getActivity.getResources getClass().getClassLoader().getResource("file.txt").getFile();

我的项目结构如下:

src
--main
----java
----res
--test
----java
----resources

如何从AndroidTestCase访问resources文件夹中的文件?

getActivity.getResources
getClass().getClassLoader().getResource("file.txt").getFile();