open.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView,
boolean isChecked) {
// TODO Auto-generated method stub
if (isChecked) {
mBluetoothAdapter.enable();//打开蓝牙
} else {
mBluetoothAdapter.disable();// 关闭蓝牙
}
}
});