First page Back Continue Last page Overview Graphics
取得系統藍芽功能
- BluetoothAdapter BA;
BA = BluetoothAdapter.getDefaultAdapter();
if (BA == null) {
msg.setText("No Bluetooth support !");
}
else if (!BA.isEnabled()) {//要求開啓藍芽
Intent enableBT = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBT, 1);
}
else msg.setText("Bluetooth OK");