姬長信(Redy)

android – Onscroll选中的复选框使用listiview…


在我的应用程序中我添加了ListView复选框,我也给了复选框的限制,用户不能选择超过5复选框,但问题是滚动我选中的复选框取消选中以下是我的代码片段,任何人都可以帮我这个
public class CustomAdapter extends BaseAdapter {

    private LayoutInflater inflater = null;
    Context context;

    String rup = "/u20B9";
    private ArrayList listData;
    boolean checked[];

    public CustomAdapterPooja(Context mainActivity, ArrayList listData) {
        // TODO Auto-generated constructor stub

        context = mainActivity;
        this.listData = listData;
        inflater = (LayoutInflater) context.
                getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        checked = new boolean[listData.size()];
        for (int i = 0; i = 5 ? true : false;
    }

    public class ViewHolder {
        TextView tv;
        TextView serviceprice;
        public CheckBox checks;
        public TextView dayss;
        public TextView txtseledates;
    }


}