如何将列表视图按钮中的收音机添加到收音机组?
这是 OnItemClick 的代码
lvSearchResult.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position,
long id) {
final HashMap<String, String> item = (HashMap<String, String>) parent.getItemAtPosition(position);
final RadioButton rbAddITem = (RadioButton)parent.getChildAt(position).findViewById(R.id.rbAddItem_Radio);
String searchQuery = item.get("ProductName").toString();
if(rbAddITem.isChecked()){
rbAddITem.setChecked(false);
}else{
rbAddITem.setChecked(true);
}
}
});
}
非常感谢你的帮助。