I am working with bluetooth application. After running the app two bluetooth enabled devices are getting connected. But if in the mid time any call came then the bluetooth automatically disconnected. But it should not be like that. How can I resolve this problem?
I am working with bluetooth application. After running the app two bluetooth enabled devices
Share
You probably need to move your Bluetooth communication code into a Service: the only time this should happen is if your app’s
Activityis getting paused or destroyed when the call comes in. If you move the Bluetooth communication code into a Service then it will continue to run in the Background even when the Activity is paused or destroyed.You can use PhoneStateListener in your Service to determine when the call ends and then relaunch your Activity.