I have just imported Android's BluetoothChat example into Eclipse. In the Android manifest, I can see that the option android:configChanges="orientation"
was already there. However, when I tested the app on two real phones, the connection was always lost whenever I rotated the screen.
In another thread, a user reported that the connection was not lost when the android:configChanges="orientation"
option was there, but this is not what I have experienced.
The only modification I have made to the code is to add the line
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
right after super.onCreate()
in the onCreate()
method. This change was made to fix a null pointer exception and I don't think it has anything to do with the screen rotation problem. Does anyone know what is the cause of lost connections and how to fix the issue?