아래 소스는 폰에서 블루투스가 켜져 있지 않으면 ON시키겟냐고 물어보는 소스입니다
boolean supportConfirm() {
BluetoothAdapter Bl = BluetoothAdapter.getDefaultAdapter();
if(Bl.equals(null)){
return false;
}
mBluetoothAdapter = Bl;
return true;
}
boolean OnffConfirm() {
boolean btEnable = mBluetoothAdapter.isEnabled();
if(btEnable == true){
return true;
}
Intent BtOn = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(BtOn, REQUEST_ENABLE_BLUETOOTH);
return false;
}
폰에서 안물어보고 블루투스를 ON시키는 방법이 없을까요?