pulltorefreshlistview 和xlistview 中的获取item控件布局时出现的类转换异常的问题:

pulltorefreshlistview 和xlistview 中的出现的类转换异常的问题在于
这两个listview都有头部和尾部在获取listview的子布局的时候应该这样:
//全选操作
public void selectAll(){
    System.out.println("gouwucheactivity中的count----"+listView.getChildCount());
    for ( int index = 1; index < listView.getChildCount()-1; index++) {
        RelativeLayout layout = (RelativeLayout) listView.getChildAt(index);
        //            RelativeLayout layout = (RelativeLayout) ptr_listView.getChildAt(index);
        //            04-05 17:31:20.632: E/AndroidRuntime(28214): java.lang.ClassCastException: com.library.listview.XListViewHeader cannot be cast to android.widget.RelativeLayout

        CheckBox checkBox = (CheckBox) layout.findViewById(R.id.check_gouwu_select);
        //            CheckBox check_top = (CheckBox) layout.findViewById(R.id.check_gouwu_select1);
        checkBox.setChecked(true);
        //            check_top.setChecked(true);
        System.out.println("gouwucheactivity在购物车的selectAll方法中调用了");
    }
}
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值