@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_BLUETOOTH_SCAN && resultCode == RESULT_OK) { final BluetoothDevice fBluetoothDevice = (BluetoothDevice) data .getParcelableExtra("device"); if (fBluetoothDevice != null) { Log.i(TAG, "Bluetooth device name = " + fBluetoothDevice.getName() + ", address = " + fBluetoothDevice.getAddress()); mMidiManager.openBluetoothDevice(fBluetoothDevice, new MidiManager.OnDeviceOpenedListener() { @Override public void onDeviceOpened(MidiDevice device) { onBluetoothDeviceOpen(fBluetoothDevice, device); } }, null); } } }