Problem description
Rt.
/* Stop Client connection */private void Shutdownclient () {new Thread () {public void run () {if (clientconnectthread! = null) {Clientconne Ctthread.interrupt (); LOG.I ("1111111111111111111111111111111", "5555555555555555555555555555555555"); clientconnectthread = null;} if (mreadthread! = null) {mreadthread.interrupt (); LOG.I ("1111111111111111111111111111111", "44444444444444444444444444444"); mreadthread = null;} if (socket! = NULL) {try {socket.close (); LOG.I ("1111111111111111111111111111111", "3333333333333333333333333");} catch (IOException e) {//TODO auto-generated catch Blocke.printstacktrace ();} socket = null;}};}. Start ();}
When you go to the Close method, the program crashes and exits. I didn't report anything wrong! Solutions 1
You're supposed to be doing this. Monitor thread is listening on the rest of the thread, it is recommended to lock the operation. Do not close, or judge the data directly.
Android Bluetoothsocket call Close when program crashes