I connect my tablet with a bluetooth module of Chinese origin (it works like a master). When you rotate the screen, all threads are killed and new ones are created. If after turning the screen and before the line
socket.connect() do not delay, then the connection fails. With a delay of 100 ms, everything is connected. Question two:
- Am I doing right that I am killing an existing compound (maybe there is some way to keep it - in general, the streams remain alive after turning the screen)? Now I save the address of the remote device with the savedInstanceState and when I turn the screen I re-create the connection stream and the connection processing thread.
- If the first question is "yes", then what delay is better to put. In my opinion, 100 ms is a lot (I don't want to poke ...)