Assets文件夹

来源:互联网 发布:淘宝买的鲜人参怎么样 编辑:程序博客网 时间:2024/05/22 06:41
try {
Context ctxDealFile = this.createPackageContext("com.example.dynamicaction",
        Context.CONTEXT_IGNORE_SECURITY);
Context context=ctxDealFile;
String uiFileName = "dexdir";
// 只能列出assets/dexdir 中的子目录和子文件(不列出子子目录和子子文件)
String str[] = context.getAssets().list(uiFileName);
for (int i = 0; i < str.length; i++) {
System.err.println("===> "+str[i]);
}
// 列出assets/ 中的所有子目录和子文件
String str222[] = context.getAssets().list("");
for (int i = 0; i < str222.length; i++) {
System.err.println("=222==> "+str222[i]);
}
} catch (Exception e) {
e.printStackTrace();
}
0 0
原创粉丝点击