@Override
 protected void onPostResume() {
   super.onPostResume();
   Session.getInstance().addObserver(this);
   updateUIOnLoginOut();
   AppVersion appVersion = Session.getInstance().getAppVersion();
   if (ConnectedApp.APPVERSION_CHECK_ENABLED && appVersion != null && appVersion.forceUpdate())
     setNavigationDisabled(true);
 }
 public boolean shouldShowUpdateDialog(AppVersion appVersion) {
   if (!ConnectedApp.APPVERSION_CHECK_ENABLED) return false;
   if (!appVersion.updateAvailable()) return false;
   if (appVersion.forceUpdate()) return true;
   SharedPreferences settings =
       getSharedPreferences(AppConfig.PREFS_FILE_USERPREFS, Context.MODE_PRIVATE);
   long updateReminderTime = settings.getLong(AppConfig.HOME_UPDATEREMINDER_TIME, 0);
   long now = System.currentTimeMillis();
   if ((updateReminderTime + UPDATE_REMINDER_INTERVAL) < now) {
     SharedPreferences.Editor editor = settings.edit();
     editor.putLong(AppConfig.HOME_UPDATEREMINDER_TIME, now);
     editor.commit();
     return true;
   }
   return false;
 }