How to make Toggle button programmatically On & OFF in Android?

Jai Android picture Jai Android · Jun 24, 2011 · Viewed 39.3k times · Source

I need to make Toggle button programmatically On & OFF.

Answer

Haris Hasan picture Haris Hasan · Jun 24, 2011

You can use toggleButton.setChecked(true or false) method to make Toggle button programmatically On & OFF.