button1 [์๋๋ก์ด๋] Switch ๋ฒํผ ์ฌ์ฉ๋ฒ public class MainActivity extends AppCompatActivity { int nChecked = 0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Switch switchButton = findViewById(R.id.sw_opt); switchButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButt.. 2021. 3. 22. ์ด์ 1 ๋ค์