I am desperate for a solution to this problem, for some reason on another device on which I tested the bluetooth application when I close the application (onDestroy ()) and reconnect it to the bluetooth connections. The only solution for this is to turn Bluetooth off and on for the device.
The code I use is more or less a bluetoothchat example for Android. I create 2 bt connections to a previously selected device.
Then I communicate with these sockets using input and output streams.
When my application is destroyed - I close the input and output data and bluetooth sockets, I even kill the process (I found some code here), but when I return to the application, the connection will fail.
Can anyone offer any help from what I said so far? My code is pretty much right now, so I didn't know what to insert, but the bt connection basically uses the classes from the sample and then passes these created sockets to my other classes.
Thanks in advance
source share