2010-08-09 6 views
8

Possible en double:
Official reasons for “Software caused connection abort: socket write error”Android Bluetooth: le logiciel a-t-il causé une interruption de connexion IOException?

J'ai des problèmes avec BluetoothChat Je ne peux pas se connecter Droid. Je reçois toujours cette IOException

08-09 20:58:24.889: INFO/BluetoothChat(17378): MESSAGE_STATE_CHANGE: 3 
08-09 20:58:51.053: DEBUG/BluetoothService(17378): BT_SEND_MESSAGE 
08-09 20:58:51.108: ERROR/BluetoothService(17378): disconnected 
08-09 20:58:51.108: ERROR/BluetoothService(17378): java.io.IOException: Software caused connection abort 
08-09 20:58:51.108: ERROR/BluetoothService(17378):  at android.bluetooth.BluetoothSocket.readNative (Native Method) 
08-09 20:58:51.108: ERROR/BluetoothService(17378):  at android.bluetooth.BluetoothSocket.read(BluetoothSocket.java:286) 
08-09 20:58:51.108: ERROR/BluetoothService(17378):  at android.bluetooth.BluetoothInputStream.read(BluetoothInputStream.java:96) 
08-09 20:58:51.108: ERROR/BluetoothService(17378):  at java.io.InputStream.read(InputStream.java:133) 
08-09 20:58:51.108: ERROR/BluetoothService(17378):  at my.test.BluetoothChatService$ConnectedThread.run(BluetoothChatService.java:356) 

Comment puis-je résoudre ce problème?

+1

Utilisez-vous le code exactement si ne pas afficher du code. Et aussi s'inscrire en tant qu'utilisateur et accepter quelques réponses 0% d'acceptation ne nous donne pas envie de vous aider autant – JPM

Répondre

-2
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> 
    <uses-permission android:name="android.permission.BLUETOOTH" /> 
    <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission> 
    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"></uses-permission> 

Ajouter ces autorisations.

+3

Vous auriez pu éditer votre réponse précédente au lieu de la supprimer et d'en ajouter une autre. Cette réponse serait mieux si vous avez ajouté un peu de texte pour expliquer le problème et pourquoi cela le corrige. – Flexo