判断状态用 isChecked() if(switch1.isChecked()) { Toast.makeText(getApplicationContext(), "蓝牙已经打开了",Toast.LENGTH_LONG).show();} else { Toast.makeText(getApplicationContext(), "蓝牙已经关闭了", Toast.LENGTH_LONG).show(); }