how to change state of a switch programmatically andoir dstudio

Solutions on MaxInterview for how to change state of a switch programmatically andoir dstudio by the best coders in the world

showing results for - "how to change state of a switch programmatically andoir dstudio"
Ivanna
31 Feb 2018
1Switch a; // define your switch
2
3
4a.setOnClickListener(
5     new View.OnClickListener() {
6         @Override
7         public void onClick(View view) {
8               b.setChecked(!b.isChecked);
9         }
10      });
11