Recently i am doing a project using an android application to connect to a bluno(arduino with bluetooth) to control some servo via serial comm.
In the MainActivity , once the bluetooth connection is establish , I am able to send serial comm to do some output to the bluno.
In the MainActivity , I had start bluetooth as service and used bindService so that it would carry the connection to any activity so as long the application is not destroy.
The problem comes in when i created a 2nd activity , I tried to access the 2nd activity via MainActivity and the bluetooth connection is gone.
I have been looking at it for few days but unable to know how to fix this issue. My suspect is maybe the way which android lifecycle is handled ?
I used the base code from GitHub - DFRobot/BlunoBasicDemo: The basic demo for bluno
And edit it to build more function.