0

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

TLGINO
  • 1
  • 1
  • https://stackoverflow.com/questions/42666559/android-databinding-how-to-avoid-oncheckedchanged-triggered-by-programmatically Try this – Pratham Khurana Jun 21 '21 at 11:13

0 Answers0