0
많은 라이브러리가있는 Android Studio에 프로젝트가 있습니다. 기본 프로젝트에는 assets 폴더 (두 개의 폴더가 있음)가 있으며 라이브러리에는 assets 폴더가 없습니다.저작물 가져 오기가 저작물 파일을 가져 오지 않습니다.
이 코드가 있습니다
public static final Pattern LENGUAJES = Pattern.compile("html-(.+)");
public static List<String> getLenguajesHelp(Context oContext) {
ArrayList<String> oLens = new ArrayList<String>();
AssetManager assetManager = oContext.getAssets();
try {
String[] oFiles = assetManager.list("");
for (int i = 0; i < oFiles.length; i++) {
Log.v("probandoElMatcher", oFiles[i]);
Matcher oMat = LENGUAJES.matcher(oFiles[i]);
if (oMat.find()) {
oLens.add(oMat.group(1));
}
}
} catch (IOException oEx) {
oEx.printStackTrace();
}
return oLens;
}
Context
의 주요 프로젝트입니다 (자산 폴더에 I라는 이름의 폴더가를 HTML-ES, 아이디어는 방법은 해당 폴더와 일치한다는 것입니다)하지만, 메서드 getAssets.list()
은 내가 assets 폴더에없는 파일 목록을 반환하며 대부분이 .pak
개의 파일입니다. 무엇이 문제일까요?
가능한 복제본 : [에셋 폴더의 파일 목록] (http://stackoverflow.com/questions/16234529/list-of-files-in-assets- 폴더 및 하위 폴더) – HelloSadness
문제는 내가 읽고 자하는 폴더가 루트이고 getAssets.list가 해당 폴더를 반환하지 않는다는 것입니다. 하지만 고마워. – dpart