我正在开发一个应用程序,在我的应用程序中,我使用Listview显示数据使用dom解析,我想在listview中页脚,当我点击页脚附加更多数据添加到列表视图,我附加图像,我想要那个设计和过程,请参考image1和imgae2.I提到红色矩形的页脚
Fig1-Footer喜欢"更多新闻"


图2 - 在listview中添加额外的10条记录
我正在尝试向ExpandableListView添加标头,如下所示:
headerView = View.inflate(this, R.layout.header, null);
expandableListView.addHeaderView(headerView);
expandableListView.setAdapter(new SectionedAdapter(this));
Run Code Online (Sandbox Code Playgroud)
这给了我以下错误:
12-08 16:23:42.354:
ERROR/AndroidRuntime(421): Caused by:java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams
12-08 16:23:42.354: ERROR/AndroidRuntime(421): at android.widget.ListView.clearRecycledState(ListView.java:504)
12-08 16:23:42.354: ERROR/AndroidRuntime(421): at android.widget.ListView.resetList(ListView.java:490)
12-08 16:23:42.354:ERROR/AndroidRuntime(421):at android.widget.ListView.setAdapter(ListView.java:422)
12-08 16:23:42.354:ERROR/AndroidRuntime(421): at android.widget.ExpandableListView.setAdapter(ExpandableListView.java:475)
Run Code Online (Sandbox Code Playgroud)
这是在电话会议上发生的expandableListView.setAdapter(new SectionedAdapter(this)),但我无法弄清楚原因.有任何想法吗?
android classcastexception expandablelistview android-linearlayout