@Override protected void onPause() { super.onPause(); TheLifeConfiguration.getOwnerDS().removeDSChangedListener(m_support); TheLifeConfiguration.getRequestsDS().removeDSChangedListener(m_support); }
@Override protected void onResume() { super.onResume(); // guard against a not-valid user if (!TheLifeConfiguration.getOwnerDS().isValidOwner()) { Intent intent = new Intent("com.p2c.thelife.Setup"); startActivity(intent); finish(); } TheLifeConfiguration.getRequestsDS().addDSChangedListener(m_support); TheLifeConfiguration.getOwnerDS().addDSChangedListener(m_support); // defensive programming: in case of problems with GCM, refresh requests datastore TheLifeConfiguration.getRequestsDS().refresh("application"); }