I'm trying to implement clearing all the check marks of check boxes on single button click, code seems okay for me but it isn't working. Checkboxes is in different layout...in my present activity I'm inflating the checkboxes and doing setChecked(false)(which is not working)..is there any another way?
Button clearbtn1 = (Button) findViewById(R.id.clearbtn);
clearbtn1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
LayoutInflater inflater_example = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v1= inflater_example.inflate(R.layout.profile, null);
CheckBox checkBox = (CheckBox) v1.findViewById(R.id.checkBox1);
checkBox.setChecked(false);
}
});
Any help would be appreciated.