蓝牙串口助手(Android Studio源码)
public void onActivityResult(int requestCode, int resultCode, Intent data) {
Log.e(TAG, "onActivityResult");
switch (requestCode) {
case REQUEST_CONNECT_DEVICE:
if (resultCode == Activity.RESULT_OK) {
// 提取蓝牙地址数据
String address = data.getExtras().getString(DeviceListActivity.DEVICE_ADDRESS);
// 获取设备
BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);