示例#1
0
  /**
   * On resume we refresh the folder list (in the background) and we refresh the messages for any
   * folder that is currently open. This guarantees that things like unread message count and read
   * status are updated.
   */
  @Override
  public void onResume() {
    super.onResume();

    if (!mAccount.isAvailable(this)) {
      Log.i(K9.LOG_TAG, "account unavaliabale, not showing folder-list but account-list");
      startActivity(new Intent(this, Accounts.class));
      finish();
      return;
    }
    if (mAdapter == null) initializeActivityView();

    MessagingController.getInstance(getApplication()).addListener(mAdapter.mListener);
    // mAccount.refresh(Preferences.getPreferences(this));
    MessagingController.getInstance(getApplication())
        .getAccountStats(this, mAccount, mAdapter.mListener);

    onRefresh(!REFRESH_REMOTE);

    MessagingController.getInstance(getApplication()).notifyAccountCancel(this, mAccount);
  }