例如,如果我有一堂课:
class Folder {
public String name;
public ArrayList<Folder> subFolders;
public ArrayList<Folder> subFolders;
}
我正在尝试填充ListView
自定义ArrayAdapter
,然后浏览这个ArrayList
充满数据的“文件夹”。我尝试这样的事情来展示subFolders
:
private OnItemClickListener listlistener = new OnItemClickListener() {
@Override
public void onItemClick(int position, long arg3) {
currentFolder = (Category) parent.getItemAtPosition(position);
folders = currentFolder.subFolders;
folderAdapter.notifyDataSetChanged();
}
};
但它不起作用。有什么建议可以帮助解决这个问题吗?