I have a strange issue with bluetooth socket. If I create socket and later close application, android device freeze with very hight CPU load.
Here my sample code:
<
Take a look at the code that calls cancel(). In particular, look at how it handles runtime exceptions thrown by cancel(). The code above will throw a NPE if cancel() is called after ConnectThread() catches an exception.
Also, check any loops where you perform an operation on socket. Once the close() is called, connect(), getInputStream(), and getOutputStream() will throw IOEs.