I'm looking for an easy way to create an indicator light that I can toggle on and off. Radiobuttons seem great for this, they even look like lights, but you can't toggle them off. Is there an easy way to modify them so that they can be toggled off? Or is there an even simpler solution?
(I'd rather not use the toggle button, I need a round light)
You could try using a RadioButton and override the onClick(...) method to simply toggle the checked state yourself with...
myRadioButton.setChecked(!myRadioButton.isChecked());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With