Skip to content

Instantly share code, notes, and snippets.

@sidishere
Created December 24, 2019 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sidishere/30b10c9ce2c9272121ff2f6f8391d320 to your computer and use it in GitHub Desktop.
Save sidishere/30b10c9ce2c9272121ff2f6f8391d320 to your computer and use it in GitHub Desktop.
s1.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (s4.isChecked())
if (s1.isChecked())
smartAC.setValue(("ON"));
else
smartAC.setValue("OFF");
else
if(s1.isChecked()){
s1.setChecked(false);
Toast.makeText(getApplicationContext(),"Enable master switch",Toast.LENGTH_SHORT).show();
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment