I'm using a lib Android-BluetoothSPPLibrary (https://github.com/akexorcist/Android-BluetoothSPPLibrary)
I am creating an application to communicate with the Arduino.
I have two activities. The first to connect to the device. The second to send and receive data.
That part when the Bluetooth is connected and calls the second activity.
public void onDeviceConnected(String s, String s1) {
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
intent.putExtras(bundle);
startActivity(intent);
}
The Bluetooth connects but when going to the second activity it disconnects, but the light is still on and was connected for the first activity.