@Override
  protected void onPause() {
    super.onPause();
    getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
  }
Called when Activity is about to lose focus. Unregisters the
OnSharedPreferenceChangeListener.
OCRTest/src/main/java/edu/sfsu/cs/orange/ocr/PreferencesActivity.java