// ///////////////////////////////////////////////////////////////////////////
  // 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 onReceive(Context context, Intent intent) {
      Log.d(TAG, intent.getAction());
      if (intent.getAction() == null) {
        return;
      }

      if (IntentIntegrator.ACTION_SYNCHRO_COMPLETED.equals(intent.getAction())) {
        displayFavoriteStatut();
      } else if (IntentIntegrator.ACTION_CONFIGURATION_MENU.equals(intent.getAction())) {
        configurationManager =
            ApplicationManager.getInstance(getActivity()).getConfigurationManager();
        if (configurationManager != null
            && configurationManager.getConfigurationState()
                == ConfigurationManager.STATE_HAS_CONFIGURATION) {
          configure(
              configurationManager.getConfig(
                  AccountManager.retrieveAccount(
                      context, intent.getExtras().getLong(IntentIntegrator.EXTRA_ACCOUNT_ID))));
        } else {
          display();
        }
      }
    }