title: how to change state of a Switch programmatically [Android]
body: <p>I've to Switches A &amp; B. I want whenever would I tap on switch A, it will change the state of B and vice versa.
  How to do that in Android studio?</p>
  
  <p>Here's my code of Switches</p>
  
  <pre><code>    //first switch
          flw_Rate_switch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
  
  
              @Override
              public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                  if (isChecked) {
  
  }...
  
  
  //2nd switch
          lqd_followed_switch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
  
              @Override
              public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                  if (isChecked) {
  
  
  }...
  </code></pre>