@Override public void onPause() { super.onPause(); mTestSP.unregisterOnSharedPreferenceChangeListener(mTestCardListener); mFoodSP.unregisterOnSharedPreferenceChangeListener(mFoodCardListener); mPoolSP.unregisterOnSharedPreferenceChangeListener(mPoolCardListener); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mSocket = HereAndNowApplication.getSocket(); mTestSP = getActivity().getSharedPreferences(TEST_KEY, Context.MODE_PRIVATE); mFoodSP = getActivity().getSharedPreferences(FOOD_KEY, Context.MODE_PRIVATE); mPoolSP = getActivity().getSharedPreferences(POOL_KEY, Context.MODE_PRIVATE); }