// ///////////////////////////////////////////////////////////////////////////
  // LIFECYCLE
  // ///////////////////////////////////////////////////////////////////////////
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    rootView = inflater.inflate(R.layout.app_main_menu, container, false);

    spinnerAccount = (Spinner) rootView.findViewById(R.id.accounts_spinner);
    spinnerAccount.setOnItemSelectedListener(this);

    menuFavorites = (Button) rootView.findViewById(R.id.menu_favorites);

    if (SLIDING_TAG.equals(getTag())) {
      menuSlidingFavorites = (Button) rootView.findViewById(R.id.menu_favorites);
    }

    configurationManager = ApplicationManager.getInstance(getActivity()).getConfigurationManager();
    if (configurationManager != null
        && configurationManager.getConfigurationState()
            == ConfigurationManager.STATE_HAS_CONFIGURATION) {
      configure(configurationManager.getConfig(SessionUtils.getAccount(getActivity())));
    } else {
      display();
    }

    return rootView;
  }
  @Override
  public void onResume() {
    super.onResume();
    getActivity().getActionBar().setDisplayHomeAsUpEnabled(false);
    getActivity().getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);

    IntentFilter intentFilter = new IntentFilter(IntentIntegrator.ACTION_SYNCHRO_COMPLETED);
    intentFilter.addAction(IntentIntegrator.ACTION_CONFIGURATION_MENU);
    receiver = new MainMenuReceiver();
    LocalBroadcastManager.getInstance(getActivity()).registerReceiver(receiver, intentFilter);

    displayFavoriteStatut();

    if (configurationManager != null
        && configurationManager.getConfigurationState()
            == ConfigurationManager.STATE_HAS_CONFIGURATION) {
      configure(configurationManager.getConfig(SessionUtils.getAccount(getActivity())));
    } else {
      display();
    }
  }