如何将listview按钮中的广播添加到radioGroup?
这是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);
}
}
});
}
非常感谢你的帮助。