Created
July 20, 2012 22:07
-
-
Save topgenorth/3153595 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean isConfigurationChanging = false; // instance variable on the activity | |
@Override | |
public Object onRetainNonConfigurationInstance() { | |
isConfigurationChanging=true; | |
} | |
@Override | |
public void onStop() { | |
// Could also be onDestroy(); | |
super.onStop(); | |
if (!isConfigurationChanging) { | |
getApplicationContext().unbindService(state); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment