I've been changing over some app menu options lately in order to simplify the graphics and give me more space to work with. I added a radio button, and have it set up to toggle on and off when pressed via a listener:
View.OnClickListener toggleListener = view -> {
Settings.getSetting().toggleSetting();
holder.settingToggleButton.setChecked(!holder.settingToggleButton.isChecked());
};
...
holder.settingToggleButton.setOnClickListener(toggleListener);
But when I load into my app and toggle the button, it'll work initially (options that are on get toggled off, and vice versa) but when I then try to tap it again and toggle the option back on/off, it doesn't work. It sticks either on or off, whichever state it was initially toggled into when I first pressed it. I'm not sure why this is happening, as the logic is very straight-forward... any ideas as to why this set up isn't working?
I have discovered the answer to my question; it's a niche solution related directly to my problem, but overall, it was indeed related to not checking for/modifying the ID of the toggle button. If you're ever having issues with the button toggling one way but not the other, or not toggling at all, make sure all references to that button, and all the changes it's involved in, take it into account.