2012-01-03 50 views
0

我只有传出连接有这个问题。我coppied我的源代码的大部分地区从例如http://developer.android.com/guide/topics/wireless/bluetooth.htmlBluetoothSocket accept()IOException

所以我不真的知道什么这个问题的原因是...

首先把代码中的IOException异常occures:

try { 
       // This is a blocking call and will only return on a 
       // successful connection or an exception 
       socket = mmServerSocket.accept(); 
      } catch (IOException e) { 
       Log.e(TAG, "Socket Type: " + mSocketType + "accept() failed", e); 
       break; 
      } 

每次我我的手机连接到我的平板电脑接受()抛出IOException我的手机上:

BluetoothChatService插槽类型:nullaccept()失败 BluetoothChatService java.io.IOExcep重刑:操作被取消

我相信这是某种联系到在这个博客中描述的问题: http://www.androiddiscuss.com/1-android-discuss/86844.html

由BluetoothConnection效果很好的方式,但我的手机收到不容任何数据。

编辑:刚才我意识到,从我的Galaxy S到我的摩托罗拉XOOM蓝牙连接无法从市场上其他流行的蓝牙应用程序建立...

如果我的其他方式连接轮,从我的平板电脑到我的手机,平板电脑只是完全重新启动。

+0

你可以粘贴堆栈跟踪,以便我们可以看到发生了什么。也许一端是过早关闭连接 – 2012-01-05 07:44:12

回答

0

这可能是一个身份验证问题。你的设备是否配对?

+0

是的。他们配对,或者在偏好中说。 – Gingerbread123321 2012-01-03 14:36:00