private void updateHeader() {
    if (finger == null) {
      if (peer == null) {
        LOG.warn("Something wrong, finger  and peer are null");
        return;
      } else {
        finger = peer.finger();
      }
    }

    if (header != null) {

      byte fileType = adapter != null ? adapter.getFileType() : Constants.FILE_TYPE_AUDIO;

      int numTotal = 0;

      switch (fileType) {
        case Constants.FILE_TYPE_TORRENTS:
          numTotal = finger.numTotalTorrentFiles;
          break;
        case Constants.FILE_TYPE_AUDIO:
          numTotal = finger.numTotalAudioFiles;
          break;
        case Constants.FILE_TYPE_DOCUMENTS:
          numTotal = finger.numTotalDocumentFiles;
          break;
        case Constants.FILE_TYPE_PICTURES:
          numTotal = finger.numTotalPictureFiles;
          break;
        case Constants.FILE_TYPE_RINGTONES:
          numTotal = finger.numTotalRingtoneFiles;
          break;
        case Constants.FILE_TYPE_VIDEOS:
          numTotal = finger.numTotalVideoFiles;
          break;
      }

      String fileTypeStr =
          getString(R.string.my_filetype, UIUtils.getFileTypeAsString(getResources(), fileType));

      TextView title = (TextView) header.findViewById(R.id.view_browse_peer_header_text_title);
      TextView total = (TextView) header.findViewById(R.id.view_browse_peer_header_text_total);

      title.setText(fileTypeStr);
      total.setText("(" + String.valueOf(numTotal) + ")");
    }

    if (adapter == null) {
      browseFilesButtonClick(Constants.FILE_TYPE_AUDIO);
    }

    restoreListViewScrollPosition();
  }