I have a thread A that have a connection Bluetooth toward a serial devices.
When activity restarts (an example rotation of screen), the thread die with the activity so the connection Bluetooth end. Is there a method for survive the thread A when activity restart or to survive the connection Bluetooth? without the use of service, my teacher tell me don’t use it for this application.
I have a thread A that have a connection Bluetooth toward a serial devices.
Share
Use
onRetainNonConfigurationInstance()to retain your thread. See this tutorial that covers this case.