@Override
  public void onResume() {
    displayActivateDialog();

    if (receiver == null) {
      IntentFilter intentFilter = new IntentFilter(IntentIntegrator.ACTION_SYNC_SCAN_COMPLETED);
      intentFilter.addAction(IntentIntegrator.ACTION_UPDATE_COMPLETED);
      intentFilter.addAction(IntentIntegrator.ACTION_DECRYPT_COMPLETED);
      intentFilter.addAction(IntentIntegrator.ACTION_ENCRYPT_COMPLETED);
      receiver = new FavoriteSyncReceiver();
      LocalBroadcastManager.getInstance(getActivity()).registerReceiver(receiver, intentFilter);
    }

    if (getMode() != MODE_PROGRESS) {
      hasSynchroActive = GeneralPreferences.hasActivateSync(getActivity(), acc);
    } else {
      hasSynchroActive = true;
    }

    int titleId = R.string.menu_favorites;
    if (hasSynchroActive) {
      titleId = R.string.synced_documents;
    }

    if (getFolderName() != null) {
      UIUtils.displayTitle(getActivity(), getFolderName());
    } else {
      UIUtils.displayTitle(getActivity(), getString(titleId));
    }

    super.onResume();
  }
  @Override
  protected void updateIcon(ProgressViewHolder vh, Node item) {
    if (item instanceof NodePlaceHolder) {
      UIUtils.setBackground(((View) vh.icon), null);
      vh.icon.setImageResource(MimeTypeManager.getIcon(context, item.getName()));
    } else {
      super.updateIcon(vh, item);
    }

    if (item.isFolder()) {
      vh.icon.setImageDrawable(context.getResources().getDrawable(R.drawable.mime_256_folder));

      if (mode == ListingModeFragment.MODE_IMPORT) {
        return;
      }
      if (mode == ListingModeFragment.MODE_PICK) {
        return;
      }

      UIUtils.setBackground(
          ((View) vh.choose),
          context.getResources().getDrawable(R.drawable.quickcontact_badge_overlay_light));

      vh.choose.setVisibility(View.VISIBLE);
      AccessibilityHelper.addContentDescription(
          vh.choose,
          String.format(context.getString(R.string.more_options_folder), item.getName()));
      vh.choose.setTag(R.id.node_action, item);
      vh.choose.setOnClickListener(
          new OnClickListener() {

            @Override
            public void onClick(View v) {
              Node item = (Node) v.getTag(R.id.node_action);
              selectedOptionItems.add(item);
              PopupMenu popup = new PopupMenu(context, v);
              getMenu(popup.getMenu(), item);

              if (AndroidVersion.isICSOrAbove()) {
                popup.setOnDismissListener(
                    new OnDismissListener() {
                      @Override
                      public void onDismiss(PopupMenu menu) {
                        selectedOptionItems.clear();
                      }
                    });
              }

              popup.setOnMenuItemClickListener(ProgressNodeAdapter.this);

              popup.show();
            }
          });
    } else {
      UIUtils.setBackground(((View) vh.choose), null);
    }
  }
 @Override
 protected void updateTopText(GenericViewHolder vh, String item) {
   vh.topText.setText(item);
   if (defaultCharSet.equals(item)) {
     UIUtils.setBackground(
         ((LinearLayout) vh.icon.getParent().getParent()),
         getContext().getResources().getDrawable(R.drawable.list_longpressed_holo));
   } else {
     UIUtils.setBackground(((LinearLayout) vh.icon.getParent().getParent()), null);
   }
 }
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    setRetainInstance(true);
    if (getDialog() != null) {
      getDialog().setTitle(R.string.sign_up_cloud);
      getDialog().requestWindowFeature(Window.FEATURE_LEFT_ICON);
    } else {
      UIUtils.displayTitle(getActivity(), R.string.sign_up_cloud);
    }

    View v = inflater.inflate(R.layout.app_cloud_signup, container, false);

    TextView t2 = (TextView) v.findViewById(R.id.cloud_signup_hint);
    t2.setMovementMethod(LinkMovementMethod.getInstance());

    signup = (Button) v.findViewById(R.id.cloud_signup_action);
    signup.setOnClickListener(
        new OnClickListener() {
          @Override
          public void onClick(View v) {
            signup(v);
          }
        });

    return v;
  }
  @Override
  public void onStart() {
    super.onStart();

    DisplayUtils.hideLeftTitlePane(getActivity());

    if (isAdded()
        && TAG.equals(getTag())
        && getActivity().getFragmentManager().findFragmentByTag(GeneralPreferences.TAG) == null
        && getActivity().getFragmentManager().findFragmentByTag(AboutFragment.TAG) == null) {
      ((MainActivity) getActivity()).clearScreen();
    }

    UIUtils.displayTitle(getActivity(), R.string.app_name);
    getActivity().getActionBar().setDisplayHomeAsUpEnabled(false);
  }