@SuppressWarnings("incomplete-switch")
  public void selectMenu(FragmentsAvailable menuToSelect) {
    currentFragment = menuToSelect;
    resetSelection();

    switch (menuToSelect) {
      case HISTORY:
      case HISTORY_DETAIL:
        history.setSelected(true);
        break;
      case CONTACTS:
      case CONTACT:
      case EDIT_CONTACT:
        contacts.setSelected(true);
        break;
      case DIALER:
        dialer.setSelected(true);
        break;
      case SETTINGS:
      case ACCOUNT_SETTINGS:
        settings.setSelected(true);
        break;
      case ABOUT_INSTEAD_OF_CHAT:
        aboutChat.setSelected(true);
        break;
      case ABOUT_INSTEAD_OF_SETTINGS:
        aboutSettings.setSelected(true);
        break;
      case CHATLIST:
      case CHAT:
        chat.setSelected(true);
        break;
    }
  }
  @Override
  public void onClick(View v) {
    int id = v.getId();
    resetSelection();

    if (id == R.id.history) {
      changeCurrentFragment(FragmentsAvailable.HISTORY, null);
      history.setSelected(true);
      LinphoneManager.getLc().resetMissedCallsCount();
      displayMissedCalls(0);
    } else if (id == R.id.contacts) {
      changeCurrentFragment(FragmentsAvailable.CONTACTS, null);
      contacts.setSelected(true);
    } else if (id == R.id.dialer) {
      changeCurrentFragment(FragmentsAvailable.DIALER, null);
      dialer.setSelected(true);
    } else if (id == R.id.settings) {
      changeCurrentFragment(FragmentsAvailable.SETTINGS, null);
      settings.setSelected(true);
    } else if (id == R.id.about_chat) {
      Bundle b = new Bundle();
      b.putSerializable("About", FragmentsAvailable.ABOUT_INSTEAD_OF_CHAT);
      changeCurrentFragment(FragmentsAvailable.ABOUT_INSTEAD_OF_CHAT, b);
      aboutChat.setSelected(true);
    } else if (id == R.id.about_settings) {
      Bundle b = new Bundle();
      b.putSerializable("About", FragmentsAvailable.ABOUT_INSTEAD_OF_SETTINGS);
      changeCurrentFragment(FragmentsAvailable.ABOUT_INSTEAD_OF_SETTINGS, b);
      aboutSettings.setSelected(true);
    } else if (id == R.id.chat) {
      changeCurrentFragment(FragmentsAvailable.CHATLIST, null);
      chat.setSelected(true);
    }
  }