I'm trying to get the value of each checkbox in a fragment in a neat way. Currently I'm able to retrieve the value of "checkbox1" but I would like to be able to scale this for each checkbox in the fragment. Here's the code:
binding.checkBox1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (binding.checkBox1.isChecked()){
Log.d("CHECKBOX", "is Checked");
}
else{
Log.d("CHECKBOX", "is not Checked");
}
}
});
PS: I'm new to android studio