使用此代码,它应该返回资产列表。但是当我调用 list 方法时,它会崩溃,并在调试器中显示“找不到源,编辑源查找路径...”消息:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
AssetManager assets = this.getAssets();
try {
//error happens on this next line
String[] l = assets.list(null);
} catch (IOException e) {
}
}