예제 #1
0
 @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);
 }
예제 #2
0
  @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();
  }