android 简单二级购物车的删除方法

**在二级列表的布局里写,注意写在 return view 之前**
        holder.tv_del.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                List.DataBean.DatasBean> datasBeen = childList.get(groupPosition);
                GoosBean.DataBean.DatasBean remove = datasBeen.remove(childPosition);
                if (datasBeen.size() == 0) {
                    childList.remove(groupPosition);
                    groupList.remove(groupPosition);
                }
                EventBus.getDefault().post(compute());
                notifyDataSetChanged();
            }
        });

你可能感兴趣的:(android 简单二级购物车的删除方法)