最好给出代码例子,尽量说详细点
------解决方案--------------------
添加单选按钮。为什么总是多选,
你的意思是点击了一个checkbox选中多行么?
------解决方案--------------------
http://blog.csdn.net/aomandeshangxiao/article/details/6643831 看看这个对你有帮助吗。
------解决方案--------------------
可以这样做,
在adapter里:
- Java code
@Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub GridHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.item_repairshow, null); holder = new GridHolder(); holder.rbSelect=(RadioButton)convertView.findViewById(R.id.rbSelect);//单选钮 convertView.setTag(holder); }else{ holder = (GridHolder) convertView.getTag(); } HashMap<String,Object> info = items.get(position); if (info != null) { holder.rbSelect.setOnClickListener(new lvButtonListener(position,CommonMethod.HANDLER_RADIOBUTTON)); holder.rbSelect.setChecked((Boolean)info.get("Selected")); } return convertView; }class lvButtonListener implements View.OnClickListener { private int position; private int type; lvButtonListener(int pos,int type) { position = pos; this.type=type; } @Override public void onClick(View v) { Message msg = handler.obtainMessage(); msg.what = type; msg.arg1 = position; handler.sendMessage(msg); } }