- if(myBT == null)
- {
- status.setText("this device not support Bluetooth");
- }
-
- if(!myBT.enable())
- {
- Intent enable = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
- this.startActivityForResult(enable,0);
- }
- Intent scanable = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
- this.startActivityForResult(scanable,0x2);
- status.setText("Bluetooth open success");
複製代碼 |