@Override
 public void onActivityCreated(Bundle savedInstanceState) {
   alfSession = SessionUtils.getSession(getActivity());
   SessionUtils.checkSession(getActivity(), alfSession);
   super.onActivityCreated(savedInstanceState);
   setRetainInstance(true);
 }
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {

    setRetainInstance(true);
    alfSession = SessionUtils.getSession(getActivity());
    if (RepositoryVersionHelper.isAlfrescoProduct(alfSession)) {
      setActivateThumbnail(true);
    }
    super.onActivityCreated(savedInstanceState);
  }
  public void refresh() {
    if (!ConnectivityUtils.hasNetwork((BaseActivity) getActivity())) {
      return;
    }

    if (parentFolder == null) {
      parentFolder = SessionUtils.getSession(getActivity()).getRootFolder();
    }
    super.refresh();
  }
  // //////////////////////////////////////////////////////////////////////
  // LIFE CYCLE
  // //////////////////////////////////////////////////////////////////////
  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    setRetainInstance(true);
    alfSession = SessionUtils.getSession(getActivity());
    SessionUtils.checkSession(getActivity(), alfSession);
    if (alfSession == null) {

    } else if (RepositoryVersionHelper.isAlfrescoProduct(alfSession)) {
      setActivateThumbnail(true);
    }

    // In case of Import mode, we disable thumbnails.
    if (getActivity() instanceof PublicDispatcherActivity) {
      mode = MODE_IMPORT;
      setActivateThumbnail(false);
    } else if (getActivity() instanceof PrivateDialogActivity) {
      mode = MODE_PICK;
      fragmentPick = ((PrivateDialogActivity) getActivity()).getOnPickDocumentFragment();
    }

    super.onActivityCreated(savedInstanceState);
  }
  public void getMenu(Menu menu, Node node) {
    MenuItem mi;

    Permissions permission =
        SessionUtils.getSession(context)
            .getServiceRegistry()
            .getDocumentFolderService()
            .getPermissions(node);

    mi =
        menu.add(
            Menu.NONE,
            MenuActionItem.MENU_DETAILS,
            Menu.FIRST + MenuActionItem.MENU_DETAILS,
            R.string.action_view_properties);
    mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);

    if (permission.canEdit()) {
      mi =
          menu.add(
              Menu.NONE,
              MenuActionItem.MENU_EDIT,
              Menu.FIRST + MenuActionItem.MENU_EDIT,
              R.string.action_edit_properties);
      mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
    }

    if (permission.canDelete()) {
      mi =
          menu.add(
              Menu.NONE,
              MenuActionItem.MENU_DELETE_FOLDER,
              Menu.FIRST + MenuActionItem.MENU_DELETE_FOLDER,
              R.string.delete);
      mi.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
    }
  }
 @Override
 public Loader<LoaderResult<List<CloudNetwork>>> onCreateLoader(int id, Bundle args) {
   setListShown(false);
   return new CloudNetworksLoader(
       getActivity(), (CloudSession) SessionUtils.getSession(getActivity()));
 }
 public void refresh() {
   if (parentFolder == null) {
     parentFolder = SessionUtils.getSession(getActivity()).getRootFolder();
   }
   super.refresh();
 }