Android indicator creation

I am looking for an easy way to create an indicator that I can turn on and off. Radiobuttons seem great for this, they even look like lights, but you can't turn them off. Is there an easy way to change them so that they can be turned off? Or is there an even simpler solution?

(I would prefer not to use the toggle button, I need a round light)

+3
source share
2 answers

You can try using RadioButton and override the method onClick(...)to just switch the checked state with ...

myRadioButton.setChecked(!myRadioButton.isChecked());
+3
source

I suggest you subclass the image representation and switch the image and indicate yourself.

+1

All Articles