how to increase counter on radio button is checked ? Android [closed]

I think this is what you are looking for. OnCheckedChangedListener.

RadioButton radioButton;
    radioButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if(isChecked)
                counter++;
        }
    });

Browse More Popular Posts

Leave a Comment