I have an Activity that holds a ServiceConnection to a Service. When the orientation changes the ServiceConnection appears to get lost and gets re created.
This is not desirable. I'd like to have it such that the ServiceConnection is maintained through the recreation of the Activity. I'm looking for a good pattern that solves this problem.
Take a look at Activity.onRetainNonConfigurationInstance() and the associated getLastNonConfigurationInstance() methods - they may be of use.