Now the main action (Act. A) launches a Service that supports a Bluetooth connection. (He binds the service)
The service is a modified version of BluetoothChatService (Android bluetoothChat sample) ... ... modified with added Messenger and handler according to MessengerService (Android Remote Messenger Sample)
Step A ensures that Bluetooth is connected to an external device, and then starts another action (step B).
The problem is to get the service to continue to work and to properly support the Bluetooth connection to the new action. I do not know how:
Do I need to reinstall the service to a new action and how can I guarantee that the BT connection will not be lost (due to another instance of the service)? Or I need to transfer the Messenger object to a new action in order to contact the service created using albed. If so, how can I do it better?
Very grateful for the answers!
source share