Assets文件夹

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/QQ1375235976/article/details/51543468
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();
}

猜你喜欢

转载自blog.csdn.net/QQ1375235976/article/details/51543468