Android 蓝牙连接 部分手机不成功问题(小米)
                    BluetoothAdapter.getDefaultAdapter().cancelDiscovery();
                    BluetoothDevice mDevice = mBluetoothAdapter
                            .getRemoteDevice(strAddress);
                    mSocket = mDevice
                            .createRfcommSocketToServiceRecord(MY_UUID);

                    mSocket.connect();
                    mInputStream = mSocket.getInputStream();
                    mOutputStream = mSocket.getOutputStream();

                    isConnected = true;// 讲蓝牙连接状态设置为true

                    //想连接成功的蓝牙发送一组数据
#                   mOutputStream.write(Global.connectSymbol, 0,
#                           Global.connectSymbol.length);
                    //上面这一句抛出异常,只有在小米手机上面才出现!
                    //e=IOException
                    //detailMessage=[JSR82] write :write() failed: 
                    //stackState
                    //stacktrace=null
                    suppressedExceptions=Collections$EmptyList 

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问