@Override public void onPause() { super.onPause(); // deactivate monitor if (syncStatusReceiver != null) { syncStatusReceiver.stopMonitoring(); } // deactivate any progress bar if (pullToRefreshAttacher != null) { pullToRefreshAttacher.setRefreshComplete(); } // Pause sync monitors OrgSyncService.pause(this); }
@Override public void onResume() { if (shouldRestart) { restartAndRefresh(); } super.onResume(); // activate monitor if (syncStatusReceiver != null) { syncStatusReceiver.startMonitoring(this); } // Sync if appropriate if (SyncHelper.enoughTimeSinceLastSync(this)) { SyncHelper.requestSyncIf(this, SyncHelper.ONAPPSTART); OrgSyncService.start(this); } // Check any upgrades checkPremium(); }