If you directly start a thread, then there is no way of accessing that thread from another activity and may cause memory leaks.
Your best option is to have separate Service
to manage Bluetooth connection.
You can have a separate Service
and initiate the tread
form the Service
(Service
runs in the main thread).
And You have to be careful with the starting and stopping of the Service
.
There are 2 ways to start the Service
,
You can start a Service
or you can bind to a Sstrong textervice.
In your case you will have to start the service in can bind to the service form both Activity A and Activity B, or you can start the service in Activity A and bind to it from Activity B.
But only thing you will have to be careful is when to stop the service. otherwise you will have memory leaks.
Once the service is up and running you can communicate with it from-to your Activity. and you can pass what ever information to the tread running in the Service component.
You can read on this in processes-and-threads
and services