【发布时间】:2012-10-04 00:08:04
【问题描述】:
可能重复:
Adapter class cast exception when removing a Footer view?
这是日志:
java.lang.ClassCastException: com.test.MyAdapter cannot be caste to android.widget.HeaderViewListAdapter
at android.widget.ListView.removeFooterView(ListView.java:387)
at com.test.MyActivity.removeFooterViews()
MyAdapter 是一个多列表适配器。真的没有看到删除页脚与将我的适配器转换为 android.widget.HeaderViewListAdapter 有什么关系?这是哪里来的?
这就是 MyActivity.removeFooterViews() 中发生的所有事情
if (myFooterView != null)
{
myListView.removeFooterView(myFooterView);
}
【问题讨论】: